Class: Jade::Decode::Desc::OneOf
- Inherits:
-
Data
- Object
- Data
- Jade::Decode::Desc::OneOf
- Includes:
- Node
- Defined in:
- lib/jade/decode.rb
Instance Attribute Summary collapse
-
#decoders ⇒ Object
readonly
Returns the value of attribute decoders.
Instance Method Summary collapse
Methods included from Node
Instance Attribute Details
#decoders ⇒ Object (readonly)
Returns the value of attribute decoders
349 350 351 |
# File 'lib/jade/decode.rb', line 349 def decoders @decoders end |
Instance Method Details
#decode(value) ⇒ Object
352 353 354 355 356 357 358 359 360 361 362 363 |
# File 'lib/jade/decode.rb', line 352 def decode(value) errors = [] decoders.each do decoded = it.decode(value) return decoded if decoded?(decoded) errors << decoded.error end Failure.new(wrap_errors(errors)) end |