Module: Representable

Included in:
Decorator
Defined in:
lib/representable.rb,
lib/representable/xml.rb,
lib/representable/hash.rb,
lib/representable/json.rb,
lib/representable/yaml.rb,
lib/representable/config.rb,
lib/representable/mapper.rb,
lib/representable/binding.rb,
lib/representable/version.rb,
lib/representable/decorator.rb,
lib/representable/definition.rb,
lib/representable/deprecations.rb,
lib/representable/hash_methods.rb,
lib/representable/bindings/xml_bindings.rb,
lib/representable/bindings/hash_bindings.rb,
lib/representable/bindings/yaml_bindings.rb,
lib/representable/feature/readable_writeable.rb

Defined Under Namespace

Modules: ClassInclusions, ClassMethods, Coercion, DSLAdditions, Deprecations, Feature, Hash, HashMethods, JSON, ModuleExtensions, XML, YAML Classes: Binding, Config, Decorator, Definition, Mapper

Constant Summary collapse

VERSION =
"1.6.1"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#representable_attrs=(value) ⇒ Object

Sets the attribute representable_attrs

Parameters:

  • value

    the value to set the attribute representable_attrs to.



7
8
9
# File 'lib/representable.rb', line 7

def representable_attrs=(value)
  @representable_attrs = value
end

Class Method Details

.included(base) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/representable.rb', line 9

def self.included(base)
  base.class_eval do
    extend ClassInclusions, ModuleExtensions
    extend ClassMethods
    extend ClassMethods::Declarations
    extend DSLAdditions

    include Deprecations
  end
end

Instance Method Details

#update_properties_from(doc, options, format) ⇒ Object

Reads values from doc and sets properties accordingly.



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

def update_properties_from(doc, options, format)
  # deserialize_for(bindings, mapper ? , options)
  representable_mapper(format, options).deserialize(doc, options)
end