Class: Fairy::BlockSource

Inherits:
Object
  • Object
show all
Defined in:
lib/fairy/share/block-source.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#backtraceObject (readonly)

Returns the value of attribute backtrace.



18
19
20
# File 'lib/fairy/share/block-source.rb', line 18

def backtrace
  @backtrace
end

#caller_methodObject (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

#sourceObject (readonly)

Returns the value of attribute source.



17
18
19
# File 'lib/fairy/share/block-source.rb', line 17

def source
  @source
end