Sha256: 28ddf65ff99aa4c58053a53ee151aadf126e660ef6013011443e5ee723ad435d

Contents?: true

Size: 359 Bytes

Versions: 35

Compression:

Stored size: 359 Bytes

Contents

module Troy
  class Context
    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

    def to_binding
      binding
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
troy-0.0.15 lib/troy/context.rb
troy-0.0.14 lib/troy/context.rb
troy-0.0.13 lib/troy/context.rb
troy-0.0.12 lib/troy/context.rb
troy-0.0.11 lib/troy/context.rb
troy-0.0.10 lib/troy/context.rb
troy-0.0.9 lib/troy/context.rb
troy-0.0.8 lib/troy/context.rb
troy-0.0.7 lib/troy/context.rb
troy-0.0.6 lib/troy/context.rb
troy-0.0.5 lib/troy/context.rb
troy-0.0.4 lib/troy/context.rb
troy-0.0.3 lib/troy/context.rb
troy-0.0.2 lib/troy/context.rb
troy-0.0.1 lib/troy/context.rb