Sha256: 46b0fbc5c3c8449db6ba9eccf10220045d80d58f31febaad0ba0544ad85d042b

Contents?: true

Size: 675 Bytes

Versions: 15

Compression:

Stored size: 675 Bytes

Contents

# module CloudSesame
#   module Domain
#     class Context

#       attr_reader :table

#       def initialize(table = {})
#         @table = table
#       end

#       def [](key, find_or_create = false)
#         table[key] ||= default_value(find_or_create)
#       end

#       def []=(key, value)
#         table[key] = value
#       end

#       def delete(key)
#         table.delete key
#       end

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

#       def map(&block)
#         table.map &block
#       end

#       private

#       def default_value(data)
#         data != true ? data : Context.new if data
#       end

#     end
#   end
# end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
CloudSesame-0.6.4 lib/cloud_sesame/domain/context.rb
CloudSesame-0.6.3 lib/cloud_sesame/domain/context.rb
CloudSesame-0.6.2 lib/cloud_sesame/domain/context.rb
CloudSesame-0.6.1 lib/cloud_sesame/domain/context.rb
CloudSesame-0.6.0 lib/cloud_sesame/domain/context.rb
CloudSesame-0.5.5 lib/cloud_sesame/domain/context.rb
CloudSesame-0.5.4 lib/cloud_sesame/domain/context.rb
CloudSesame-0.5.3 lib/cloud_sesame/domain/context.rb
CloudSesame-0.5.2 lib/cloud_sesame/domain/context.rb
CloudSesame-0.5.1 lib/cloud_sesame/domain/context.rb
CloudSesame-0.5.0 lib/cloud_sesame/domain/context.rb
CloudSesame-0.4.6 lib/cloud_sesame/domain/context.rb
CloudSesame-0.4.5 lib/cloud_sesame/domain/context.rb
CloudSesame-0.4.4 lib/cloud_sesame/domain/context.rb
CloudSesame-0.4.3 lib/cloud_sesame/domain/context.rb