Module: LiveAST::Attacher
- Included in:
- Linker
- Defined in:
- lib/live_ast/linker.rb
Constant Summary collapse
- VAR_NAME =
:@_live_ast
Instance Method Summary collapse
- #attach_to_method(klass, method, ast) ⇒ Object
- #attach_to_proc(obj, ast) ⇒ Object
- #fetch_method_attachment(klass, method) ⇒ Object
- #fetch_proc_attachment(obj) ⇒ Object
Instance Method Details
#attach_to_method(klass, method, ast) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/live_ast/linker.rb', line 30 def attach_to_method(klass, method, ast) unless klass.instance_variable_defined?(VAR_NAME) klass.instance_variable_set(VAR_NAME, {}) end klass.instance_variable_get(VAR_NAME)[method] = ast end |
#attach_to_proc(obj, ast) ⇒ Object
22 23 24 |
# File 'lib/live_ast/linker.rb', line 22 def attach_to_proc(obj, ast) obj.instance_variable_set(VAR_NAME, ast) end |