Class: Web::Narflates::If

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

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#condvarObject (readonly)

Returns the value of attribute condvar.



277
278
279
# File 'lib/web/template.rb', line 277

def condvar
  @condvar
end

#contentsObject (readonly)

Returns the value of attribute contents.



277
278
279
# File 'lib/web/template.rb', line 277

def contents
  @contents
end

Instance Method Details



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