Module: Representable::Object

Defined in:
lib/representable/object.rb,
lib/representable/object/binding.rb

Defined Under Namespace

Modules: ClassMethods Classes: Binding

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/representable/object.rb', line 6

def self.included(base)
  base.class_eval do
    include Representable
    extend ClassMethods
    register_feature Representable::Object
  end
end

Instance Method Details

#from_object(data, options = {}, binding_builder = Binding) ⇒ Object



21
22
23
# File 'lib/representable/object.rb', line 21

def from_object(data, options={}, binding_builder=Binding)
  update_properties_from(data, options, binding_builder)
end

#to_object(options = {}, binding_builder = Binding) ⇒ Object



25
26
27
# File 'lib/representable/object.rb', line 25

def to_object(options={}, binding_builder=Binding)
  create_representation_with(nil, options, binding_builder)
end