Class: Web::Narflates::Unless

Inherits:
Object
  • Object
show all
Defined in:
lib/web/template.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#condvarObject (readonly)

Returns the value of attribute condvar.



294
295
296
# File 'lib/web/template.rb', line 294

def condvar
  @condvar
end

#contentsObject (readonly)

Returns the value of attribute contents.



294
295
296
# File 'lib/web/template.rb', line 294

def contents
  @contents
end

Instance Method Details



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