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.35 lib/troy/context.rb
troy-0.0.34 lib/troy/context.rb
troy-0.0.33 lib/troy/context.rb
troy-0.0.32 lib/troy/context.rb
troy-0.0.31 lib/troy/context.rb
troy-0.0.30 lib/troy/context.rb
troy-0.0.29 lib/troy/context.rb
troy-0.0.28 lib/troy/context.rb
troy-0.0.27 lib/troy/context.rb
troy-0.0.26 lib/troy/context.rb
troy-0.0.25 lib/troy/context.rb
troy-0.0.24 lib/troy/context.rb
troy-0.0.23 lib/troy/context.rb
troy-0.0.22 lib/troy/context.rb
troy-0.0.21 lib/troy/context.rb
troy-0.0.20 lib/troy/context.rb
troy-0.0.19 lib/troy/context.rb
troy-0.0.18 lib/troy/context.rb
troy-0.0.17 lib/troy/context.rb
troy-0.0.16 lib/troy/context.rb