Class: LtdTemplate::Proxy::Nil

Inherits:
LtdTemplate::Proxy show all
Defined in:
lib/ltdtemplate/proxy/nil.rb

Instance Attribute Summary

Attributes included from Value

#runtime_methods

Instance Method Summary collapse

Methods inherited from LtdTemplate::Proxy

#initialize, #rubyverse_original, #rubyversed

Methods included from Value

#do_methods, #do_run_method, included, #initialize, #inspect, #rubyversed

Constructor Details

This class inherits a constructor from LtdTemplate::Proxy

Instance Method Details

#evaluate(opts = {}) ⇒ Object

Evaluate supported nil object methods.



12
13
14
15
16
17
18
19
# File 'lib/ltdtemplate/proxy/nil.rb', line 12

def evaluate (opts = {})
	case opts[:method]
	when nil, 'call' then nil
	when 'class' then 'Nil'
	when 'type' then 'nil'
	else super opts
	end
end

#tpl_booleanObject

The template boolean value is false.



22
# File 'lib/ltdtemplate/proxy/nil.rb', line 22

def tpl_boolean; false; end

#tpl_textObject

The template text for nil is the empty string.



25
# File 'lib/ltdtemplate/proxy/nil.rb', line 25

def tpl_text; ''; end