Sha256: a4f2c274417aba10203dcb90b3997f152aa4c3d94cb1bef102ce87f4c3cc473e

Contents?: true

Size: 403 Bytes

Versions: 2

Compression:

Stored size: 403 Bytes

Contents

require 'ostruct'

# A flexible Object.
# Temporarily implemented as a simple OpenStruct.

class Flexob < OpenStruct

	def update(hash)
		hash.each do |k, v|
			send("#{k}=", v)
		end
	end
	alias_method :set, :update

	def []=(key, val)
		@table[key.to_sym] = val
	end	
	
	def [](key)
		@table[key.to_sym]
	end

	def each(&block)
		@table.each(&block)
	end		
	
end

# * George Moschovitis <gm@navel.gr>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
glue-0.19.0 lib/glue/flexob.rb
glue-0.20.0 lib/glue/flexob.rb