Module: RoHelpers::Hook::ClassMethods

Defined in:
lib/ro_helpers/hook.rb

Instance Method Summary collapse

Instance Method Details

#after_eachObject



36
37
38
# File 'lib/ro_helpers/hook.rb', line 36

def after_each
  content << ctn
end

#contentObject



40
41
42
# File 'lib/ro_helpers/hook.rb', line 40

def content
  @content ||= []
end

#ctnObject



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

#targetObject



20
21
22
# File 'lib/ro_helpers/hook.rb', line 20

def target
  File.expand_path("../ro_commands", __FILE__)
end