class Representable::Hash::Binding

Public Class Methods

build_for(definition) click to toggle source
# File lib/representable/hash/binding.rb, line 6
def self.build_for(definition)
  return Collection.new(definition) if definition.array?

  new(definition)
end

Public Instance Methods

deserialize_method() click to toggle source
# File lib/representable/hash/binding.rb, line 24
def deserialize_method
  :from_hash
end
read(hash, as) click to toggle source
# File lib/representable/hash/binding.rb, line 12
def read(hash, as)
  hash.has_key?(as) ? hash[as] : FragmentNotFound
end
serialize_method() click to toggle source
# File lib/representable/hash/binding.rb, line 20
def serialize_method
  :to_hash
end
write(hash, fragment, as) click to toggle source
# File lib/representable/hash/binding.rb, line 16
def write(hash, fragment, as)
  hash[as] = fragment
end