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