Class: Irasutoya::Cli::Runner
- Inherits:
-
Thor
- Object
- Thor
- Irasutoya::Cli::Runner
- Defined in:
- lib/irasutoya/cli.rb
Instance Method Summary collapse
Instance Method Details
#random ⇒ Object
13 14 15 |
# File 'lib/irasutoya/cli.rb', line 13 def random display(Irasutoya::Irasuto.random) end |
#search(query) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/irasutoya/cli.rb', line 18 def search(query) Irasutoya::Irasuto .search(query: query) .take(3) .flat_map(&:fetch_irasuto) .compact .each(&method(:display)) end |