Class: Web::Narflates::If
Overview
:nodoc:
Instance Attribute Summary collapse
-
#condvar ⇒ Object
readonly
Returns the value of attribute condvar.
-
#contents ⇒ Object
readonly
Returns the value of attribute contents.
Instance Method Summary collapse
-
#initialize(condvar, contents) ⇒ If
constructor
A new instance of If.
- #print(globals, io) ⇒ Object
Constructor Details
#initialize(condvar, contents) ⇒ If
Returns a new instance of If.
278 279 280 281 |
# File 'lib/web/template.rb', line 278 def initialize (condvar,contents) @condvar = condvar @contents = contents end |
Instance Attribute Details
#condvar ⇒ Object (readonly)
Returns the value of attribute condvar.
277 278 279 |
# File 'lib/web/template.rb', line 277 def condvar @condvar end |
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
277 278 279 |
# File 'lib/web/template.rb', line 277 def contents @contents end |
Instance Method Details
#print(globals, io) ⇒ Object
283 284 285 286 287 288 289 290 |
# File 'lib/web/template.rb', line 283 def print (globals,io) var = globals.resolve(@condvar) if var.value && var.value != [] contents.each { |i| i.print(globals,io) } end end |