Sha256: b754c5f06071398603be17e0b02e452cb6d63bdfa9070ad499c199db005a97d0
Contents?: true
Size: 617 Bytes
Versions: 19
Compression:
Stored size: 617 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
19 entries across 19 versions & 1 rubygems