Class: Rubipara::CLI
- Inherits:
-
Thor
- Object
- Thor
- Rubipara::CLI
- Defined in:
- lib/rubipara/cli.rb
Instance Method Summary collapse
- #character(name = nil) ⇒ Object
- #episode(episode_num = nil) ⇒ Object
- #kashikoma(word = 'Kashikoma!') ⇒ Object
- #profile ⇒ Object
Instance Method Details
#character(name = nil) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rubipara/cli.rb', line 13 def character(name = nil) if name begin character = Rubipara::Character.new(name) puts_character_profile character rescue Rubipara::Character::NotFoundError => e puts e. end else Rubipara::Character.all.each {|character| puts_character_name character } end end |
#episode(episode_num = nil) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/rubipara/cli.rb', line 32 def episode(episode_num = nil) if episode_num begin episode = Rubipara::Episode.new(episode_num) puts_episode_info episode rescue Rubipara::Episode::NotFoundError => e puts e. end else Rubipara::Episode.all.each {|episode| puts_episode_info episode } end end |