Class: Remap::Rule::Map::Optional
- Inherits:
-
Concrete
- Object
- Concrete
- Remap::Rule::Map::Optional
- Defined in:
- lib/remap/rule/map/optional.rb
Instance Method Summary collapse
-
#call(state, &error) ⇒ State
Represents an optional mapping rule When the mapping fails, the value is ignored.
Instance Method Details
#call(state, &error) ⇒ State
Represents an optional mapping rule When the mapping fails, the value is ignored
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/remap/rule/map/optional.rb', line 15 def call(state, &error) unless error raise ArgumentError, "map.call(state, &error) requires a block" end fatal(state) do return ignore(state) do return notice(state) do return super end end end end |