Module: RoHelpers::Hook::ClassMethods
- Defined in:
- lib/ro_helpers/hook.rb
Instance Method Summary collapse
- #after_each ⇒ Object
- #content ⇒ Object
- #ctn ⇒ Object
- #get_meth_blk(method) ⇒ Object
- #target ⇒ Object
Instance Method Details
#after_each ⇒ Object
36 37 38 |
# File 'lib/ro_helpers/hook.rb', line 36 def after_each content << ctn end |
#content ⇒ Object
40 41 42 |
# File 'lib/ro_helpers/hook.rb', line 40 def content @content ||= [] end |
#ctn ⇒ Object
32 33 34 |
# File 'lib/ro_helpers/hook.rb', line 32 def ctn @ctn ||= "" end |
#get_meth_blk(method) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/ro_helpers/hook.rb', line 24 def get_meth_blk(method) r = self.method(method).source.split("\n") meth_blk = Proc.new do meth_ctn = (r - [r[0], r[-1]]).join("\n") eval meth_ctn end end |
#target ⇒ Object
20 21 22 |
# File 'lib/ro_helpers/hook.rb', line 20 def target File.("../ro_commands", __FILE__) end |