Class: Representable::XML::Binding
- Inherits:
-
Object
- Object
- Representable::XML::Binding
- Defined in:
- lib/representable/bindings/xml_bindings.rb
Direct Known Subclasses
AttributeBinding, NamespaceBinding, ObjectBinding, TextBinding
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.
- #value_in(xml) ⇒ Object
Constructor Details
#initialize(definition) ⇒ Binding
Returns a new instance of Binding.
7 8 9 |
# File 'lib/representable/bindings/xml_bindings.rb', line 7 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/xml_bindings.rb', line 4 def definition @definition end |
Instance Method Details
#value_in(xml) ⇒ Object
11 12 13 14 15 |
# File 'lib/representable/bindings/xml_bindings.rb', line 11 def value_in(xml) xml = Nokogiri::XML::Node.from(xml) or return default value_from_node(xml) or default end |