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.
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/troy/context.rb', line 3 def initialize( = {}) .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_binding ⇒ Object
15 16 17 |
# File 'lib/troy/context.rb', line 15 def to_binding binding end |