Class: Web::Narflates::Foreach
Overview
:nodoc:
Instance Attribute Summary collapse
-
#array ⇒ Object
readonly
Returns the value of attribute array.
-
#contents ⇒ Object
readonly
Returns the value of attribute contents.
-
#itemname ⇒ Object
readonly
Returns the value of attribute itemname.
Instance Method Summary collapse
-
#initialize(array, itemname, contents) ⇒ Foreach
constructor
A new instance of Foreach.
- #print(globals, io) ⇒ Object
Constructor Details
#initialize(array, itemname, contents) ⇒ Foreach
Returns a new instance of Foreach.
238 239 240 241 242 |
# File 'lib/web/template.rb', line 238 def initialize (array,itemname,contents) @array = array @itemname = itemname @contents = contents end |
Instance Attribute Details
#array ⇒ Object (readonly)
Returns the value of attribute array.
237 238 239 |
# File 'lib/web/template.rb', line 237 def array @array end |
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
237 238 239 |
# File 'lib/web/template.rb', line 237 def contents @contents end |
#itemname ⇒ Object (readonly)
Returns the value of attribute itemname.
237 238 239 |
# File 'lib/web/template.rb', line 237 def itemname @itemname end |
Instance Method Details
#print(globals, io) ⇒ Object
244 245 246 247 248 249 250 |
# File 'lib/web/template.rb', line 244 def print (globals,io) globals.resolve(array,@itemname).each { |item| contents.each { |i| i.print(item,io) } } end |