Class: Delorean::Formula
- Defined in:
- lib/delorean/nodes.rb
Instance Method Summary collapse
Instance Method Details
#check(context) ⇒ Object
100 101 102 |
# File 'lib/delorean/nodes.rb', line 100 def check(context, *) context.parse_define_attr(i.text_value, e.check(context)) end |
#rewrite(context) ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/delorean/nodes.rb', line 104 def rewrite(context) dname = [context.module_name, context.last_node, i.text_value].join('.') debug = Debug.debug_set.member?(dname) # an attr is defined as a class function on the node class. "class #{context.last_node}; " + "def self.#{i.text_value}#{POST}(_e); " + (debug ? "_debug =" : '') + "_e[self.name+'.#{i.text_value}'] ||= #{e.rewrite(context)};" + (debug ? 'Delorean::Debug.log(_debug); _debug;' : '') + "end; end;" end |