Class: Troy::Context

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Context

Returns a new instance of Context.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/troy/context.rb', line 5

def initialize(options = {})
  options.each do |name, value|
    instance_variable_set("@#{name}", value)

    instance_eval <<-RUBY
      def #{name}   # def name
        @#{name}    #   @name
      end           # end
    RUBY
  end
end

Instance Method Details

#to_bindingObject



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

def to_binding
  binding
end