Class: Troy::Context
- Inherits:
-
Object
- Object
- Troy::Context
- Defined in:
- lib/troy/context.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Context
constructor
A new instance of Context.
- #to_binding ⇒ Object
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( = {}) .each do |name, value| instance_variable_set(:"@#{name}", value) instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def #{name} # def name @#{name} # @name end # end RUBY end end |
Instance Method Details
#to_binding ⇒ Object
17 18 19 |
# File 'lib/troy/context.rb', line 17 def to_binding binding end |