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
14 15 16 |
# File 'lib/irasutoya/cli.rb', line 14 def random display(Irasutoya::Irasuto.random) end |
#search(query) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/irasutoya/cli.rb', line 19 def search(query) Irasutoya::Irasuto .search(query:) .take(3) .flat_map(&:fetch_irasuto) .compact .each(&method(:display)) end |