Class: Jade::Decode::Desc::Field
- Inherits:
-
Data
- Object
- Data
- Jade::Decode::Desc::Field
- Includes:
- Node
- Defined in:
- lib/jade/decode.rb
Instance Attribute Summary collapse
-
#inner ⇒ Object
readonly
Returns the value of attribute inner.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
Methods included from Node
Instance Attribute Details
#inner ⇒ Object (readonly)
Returns the value of attribute inner
108 109 110 |
# File 'lib/jade/decode.rb', line 108 def inner @inner end |
#key ⇒ Object (readonly)
Returns the value of attribute key
108 109 110 |
# File 'lib/jade/decode.rb', line 108 def key @key end |
Instance Method Details
#decode(value) ⇒ Object
111 112 113 114 115 116 117 118 119 |
# File 'lib/jade/decode.rb', line 111 def decode(value) h = coerce_hash(value) return type_err('Object', value) unless h raw = at_key(h, key.to_sym, key) return Failure.new(MissingField[key.to_s]) if ABSENT.equal?(raw) at_field(key.to_s, inner.decode(raw)) end |