Class: Gorails::Commands::Episodes
- Inherits:
-
Gorails::Command
- Object
- Gorails::Commands::Episodes
- Defined in:
- lib/gorails/commands/episodes.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
Instance Method Details
#call(_args, _name) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/gorails/commands/episodes.rb', line 8 def call(_args, _name) episodes = JSON.parse Net::HTTP.get(URI("https://gorails.com/episodes.json")) CLI::UI::Frame.open("Latest GoRails episodes") do episodes.each do |episode| puts CLI::UI.fmt "##{episode["number"]} {{green:#{episode["name"]}}}" puts episode["url"] puts end end end |