Class: Alx::ShowHandler
Instance Attribute Summary
Attributes inherited from Handler
Instance Method Summary collapse
- #handle ⇒ Object
-
#initialize(configuration) ⇒ ShowHandler
constructor
A new instance of ShowHandler.
Methods inherited from Handler
Constructor Details
#initialize(configuration) ⇒ ShowHandler
Returns a new instance of ShowHandler.
8 9 10 11 12 13 14 15 |
# File 'lib/alx/show_handler.rb', line 8 def initialize( configuration ) super( :configuration => configuration, :command => 'show', :rest_description => 'pattern', :description => "Shows book matching the given pattern.", :options => [ :html, :stdout ] ) end |
Instance Method Details
#handle ⇒ Object
17 18 19 20 21 |
# File 'lib/alx/show_handler.rb', line 17 def handle ( "No pattern given. Please provide one." ) if @conf[ :rest ].empty? load_library.list( @conf[ :rest ] ).each { | book | show_book( book ) } end |