File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -316,22 +316,22 @@ Along with params components may be passed a block which is used to build the co
316316The instance method ` children ` returns an enumerable that is used to access the unrendered children of a component.
317317
318318``` ruby
319- class IndentEachLine < Hyperstack ::Component
320- param by: 20 , type: Integer
321-
319+ class Indenter < Hyperstack ::Component
322320 render(DIV ) do
323- children.each_with_index do |child , i |
324- child.render(style: {" margin-left" => params.by* i})
321+ IndentEachLine (by: 100 ) do # see IndentEachLine below
322+ DIV {" Line 1" }
323+ DIV {" Line 2" }
324+ DIV {" Line 3" }
325325 end
326326 end
327327end
328328
329- class Indenter < Hyperstack ::Component
329+ class IndentEachLine < Hyperstack ::Component
330+ param by: 20 , type: Integer
331+
330332 render(DIV ) do
331- IndentEachLine (by: 100 ) do
332- DIV {" Line 1" }
333- DIV {" Line 2" }
334- DIV {" Line 3" }
333+ children.each_with_index do |child , i |
334+ child.render(style: {" margin-left" => params.by* i})
335335 end
336336 end
337337end
You can’t perform that action at this time.
0 commit comments