Class: Const

Inherits:
ErbPP show all
Defined in:
lib/erbpp.rb

Constant Summary

Constants inherited from ErbPP

ErbPP::ATTRS

Instance Method Summary collapse

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

#codeObject



282
283
284
# File 'lib/erbpp.rb', line 282

def code
  nil
end

#definitionObject



286
287
288
289
# File 'lib/erbpp.rb', line 286

def definition
  "/*"+desc+"*/\n    "+
    "rb_define_const(#{mod_var},\"#{name}\",#{value});"
end