Class: Maestro::Command::Find
- Inherits:
-
Maestro::Command
- Object
- Maestro::Command
- Maestro::Command::Find
- Defined in:
- lib/commands/story_commands.rb
Instance Method Summary collapse
-
#initialize(query) ⇒ Find
constructor
A new instance of Find.
- #invoke ⇒ Object
Methods inherited from Maestro::Command
Constructor Details
#initialize(query) ⇒ Find
Returns a new instance of Find.
14 15 16 |
# File 'lib/commands/story_commands.rb', line 14 def initialize(query) @query = query end |
Instance Method Details
#invoke ⇒ Object
18 19 20 21 22 23 |
# File 'lib/commands/story_commands.rb', line 18 def invoke stories = Maestro::Story.find(:all, :params => { :context => 'user', :project_id => Maestro::Config[:project_id] }) stories.select{ |s| s.title =~ Regexp.new(@query) }.collect do |story| story.to_s end.join("\n") end |