Class: Const
Constant Summary
Constants inherited from ErbPP
Instance Method Summary collapse
- #code ⇒ Object
- #definition ⇒ Object
-
#initialize(parent, name, value, desc) ⇒ Const
constructor
A new instance of Const.
Methods inherited from ErbPP
#attr_method, #attrs, #check_params, define_attrs, #has_attr?, #load_erb, #method_missing, #method_missing_alias, #parents, #result, #run, #search_method_in_parents
Constructor Details
#initialize(parent, name, value, desc) ⇒ Const
274 275 276 277 278 279 280 |
# File 'lib/erbpp.rb', line 274 def initialize(parent,name,value,desc) super(parent,nil) @name = name @value = value @desc = desc Function::DEFS.push(self) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ErbPP
Instance Method Details
#code ⇒ Object
282 283 284 |
# File 'lib/erbpp.rb', line 282 def code nil end |
#definition ⇒ Object
286 287 288 289 |
# File 'lib/erbpp.rb', line 286 def definition "/*"+desc+"*/\n "+ "rb_define_const(#{mod_var},\"#{name}\",#{value});" end |