Class: Amiba::Source::StateScope

Inherits:
Object
  • Object
show all
Defined in:
lib/amiba/source/entry_finder.rb

Instance Method Summary collapse

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