Class: Amiba::Source::StateScope
- Inherits:
-
Object
- Object
- Amiba::Source::StateScope
- Defined in:
- lib/amiba/source/entry_finder.rb
Instance Method Summary collapse
- #apply(entries) ⇒ Object
-
#initialize(state = :published) ⇒ StateScope
constructor
A new instance of StateScope.
Constructor Details
#initialize(state = :published) ⇒ StateScope
Returns a new instance of StateScope.
119 120 121 |
# File 'lib/amiba/source/entry_finder.rb', line 119 def initialize(state = :published) @state = state end |
Instance Method Details
#apply(entries) ⇒ Object
122 123 124 125 |
# File 'lib/amiba/source/entry_finder.rb', line 122 def apply(entries) return entries if @state == :any entries.select {|e| e.state.to_sym == @state} end |