Class: Sourcery::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/sourcery/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dir = nil) ⇒ Context

Returns a new instance of Context.



12
13
14
# File 'lib/sourcery/context.rb', line 12

def initialize(dir=nil)
  @metadata = Metadata.new(dir)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(s) ⇒ Object



17
18
19
# File 'lib/sourcery/context.rb', line 17

def method_missing(s)
  @metadata.send(s)
end

Instance Attribute Details

#metadataObject (readonly)

Returns the value of attribute metadata.



9
10
11
# File 'lib/sourcery/context.rb', line 9

def 
  @metadata
end

Instance Method Details

#__binding__Object

Get a clean binding.



38
39
40
# File 'lib/sourcery/context.rb', line 38

def __binding__
  binding
end

#rootObject



22
23
24
# File 'lib/sourcery/context.rb', line 22

def root
  .root
end

#to_hObject



27
28
29
# File 'lib/sourcery/context.rb', line 27

def to_h
  @metadata.to_h
end