Class: Chid::Commands::StackOverflow

Inherits:
Chid::Command show all
Defined in:
lib/chid/commands/stack_overflow.rb

Constant Summary

Constants inherited from Chid::Command

Chid::Command::COMMANDS

Instance Attribute Summary

Attributes inherited from Chid::Command

#options

Instance Method Summary collapse

Methods inherited from Chid::Command

command, help, #initialize, map_options_with_values, run

Constructor Details

This class inherits a constructor from Chid::Command

Instance Method Details

#runObject



28
29
30
31
32
33
34
# File 'lib/chid/commands/stack_overflow.rb', line 28

def run
  text_to_search = text_to_search_from_options
  text_to_search = get_text_to_search if text_to_search.empty?

  questions = ::StackOverflowApi.questions(text_to_search)
  ::Paginator.new(questions).paginate { |question| question.summary }
end