Class: Representable::JSON::Binding
- Inherits:
-
Object
- Object
- Representable::JSON::Binding
- Defined in:
- lib/representable/bindings/json_bindings.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
Instance Method Summary collapse
-
#initialize(definition) ⇒ Binding
constructor
A new instance of Binding.
- #read(hash) ⇒ Object
Constructor Details
#initialize(definition) ⇒ Binding
Returns a new instance of Binding.
6 7 8 |
# File 'lib/representable/bindings/json_bindings.rb', line 6 def initialize(definition) @definition = definition end |
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
4 5 6 |
# File 'lib/representable/bindings/json_bindings.rb', line 4 def definition @definition end |
Instance Method Details
#read(hash) ⇒ Object
10 11 12 |
# File 'lib/representable/bindings/json_bindings.rb', line 10 def read(hash) value_from_hash(hash) or default end |