Sha256: b5fb24f3612468723997642e3b0b24e7142b29085f3d9733bdba685495870e24
Contents?: true
Size: 571 Bytes
Versions: 20
Compression:
Stored size: 571 Bytes
Contents
module Scrivito class ObjDataFromHash < ObjData def initialize(hash, type_hash = {}) @hash = hash.stringify_keys @type_hash = type_hash.stringify_keys end def raw_value_and_type_of(attribute_name) [@hash[attribute_name], @type_hash[attribute_name]] end def has_custom_attribute?(name) @hash.has_key?(name) || name == '_id' end def all_attributes @all_attributes ||= begin @hash.keys | INTERNAL_KEYS.to_a | %w[_id] end end def to_h @hash end end end
Version data entries
20 entries across 20 versions & 1 rubygems