Class: CodeUnion::Command::Search
- Includes:
- Helpers::Text
- Defined in:
- lib/codeunion/command/search.rb
Overview
The built-in ‘codeunion search` command
Instance Method Summary collapse
Methods included from Helpers::Text
#format_output, #indent, #wrap
Methods inherited from Base
Constructor Details
This class inherits a constructor from CodeUnion::Command::Base
Instance Method Details
#results ⇒ Object
23 24 25 |
# File 'lib/codeunion/command/search.rb', line 23 def results @results ||= api.search() end |
#run ⇒ Object
16 17 18 19 20 21 |
# File 'lib/codeunion/command/search.rb', line 16 def run results.inject([]) do |lines, result| lines.push(CodeUnion::Search::ResultPresenter.new(result).to_s) lines << format_output("") end.join("\n") end |