Sha256: 8c4bae20cb0461b5f5b2b3898b9cb854061193e6f79765c606f6c6b66b0c0f5e
Contents?: true
Size: 750 Bytes
Versions: 5
Compression:
Stored size: 750 Bytes
Contents
require 'representable/binding' module Representable module Object class Binding < Representable::Binding def self.build_for(definition) # TODO: remove default arg. return Collection.new(definition) if definition.array? new(definition) end def read(hash, as) fragment = hash.send(as) # :getter? no, that's for parsing! return FragmentNotFound if fragment.nil? and typed? fragment end def write(hash, fragment, as) true end def deserialize_method :from_object end def serialize_method :to_object end class Collection < self include Representable::Binding::Collection end end end end
Version data entries
5 entries across 5 versions & 3 rubygems