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.



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

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



15
16
17
# File 'lib/troy/context.rb', line 15

def to_binding
  binding
end