Class: Fairy::BlockSource
- Inherits:
-
Object
- Object
- Fairy::BlockSource
- Defined in:
- lib/fairy/share/block-source.rb
Instance Attribute Summary collapse
-
#backtrace ⇒ Object
readonly
Returns the value of attribute backtrace.
-
#caller_method ⇒ Object
readonly
Returns the value of attribute caller_method.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(source) ⇒ BlockSource
constructor
A new instance of BlockSource.
Constructor Details
#initialize(source) ⇒ BlockSource
Returns a new instance of BlockSource.
8 9 10 11 12 13 14 15 |
# File 'lib/fairy/share/block-source.rb', line 8 def initialize(source) @source = source @backtrace = caller(1).select{|l| /fairy.*(share|job)/ !~ l} l = caller(1)[caller(1).index(backtrace.first)-1] #Log::debug_p(l) @caller_method = (/in `(.*)'/.match(l))[1] #Log::debug_p(@caller_method) end |
Instance Attribute Details
#backtrace ⇒ Object (readonly)
Returns the value of attribute backtrace.
18 19 20 |
# File 'lib/fairy/share/block-source.rb', line 18 def backtrace @backtrace end |
#caller_method ⇒ Object (readonly)
Returns the value of attribute caller_method.
19 20 21 |
# File 'lib/fairy/share/block-source.rb', line 19 def caller_method @caller_method end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
17 18 19 |
# File 'lib/fairy/share/block-source.rb', line 17 def source @source end |