Class: Web::Narflates::Unless
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) ⇒ Unless
constructor
A new instance of Unless.
- #print(globals, io) ⇒ Object
Constructor Details
#initialize(condvar, contents) ⇒ Unless
Returns a new instance of Unless.
295 296 297 298 |
# File 'lib/web/template.rb', line 295 def initialize (condvar,contents) @condvar = condvar @contents = contents end |
Instance Attribute Details
#condvar ⇒ Object (readonly)
Returns the value of attribute condvar.
294 295 296 |
# File 'lib/web/template.rb', line 294 def condvar @condvar end |
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
294 295 296 |
# File 'lib/web/template.rb', line 294 def contents @contents end |
Instance Method Details
#print(globals, io) ⇒ Object
300 301 302 303 304 305 306 307 |
# File 'lib/web/template.rb', line 300 def print (globals,io) var = globals.resolve(@condvar) unless var.value || var.value == [] contents.each { |i| i.print(globals,io) } end end |