Class: Remap::Selector::All
- Inherits:
-
Concrete
- Object
- Concrete
- Remap::Selector::All
- Defined in:
- lib/remap/selector/all.rb
Overview
Selects all elements from a state
Instance Method Summary collapse
-
#call(outer_state) {|| ... } ⇒ State<U>
Iterates over state and passes each value to block.
Instance Method Details
#call(outer_state) {|| ... } ⇒ State<U>
Iterates over state and passes each value to block
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/remap/selector/all.rb', line 28 def call(outer_state, &block) unless block_given? raise ArgumentError, "All selector requires an iteration block" end outer_state.bind(quantifier: "*") do |enum, state| requirement[enum] do state.fatal!("Expected enumeration but got %p (%s)", enum, enum.class) end state.map(&block) end end |