Class: Alx::ListHandler
Instance Attribute Summary
Attributes inherited from Handler
Instance Method Summary collapse
- #handle ⇒ Object
-
#initialize(configuration) ⇒ ListHandler
constructor
A new instance of ListHandler.
Methods inherited from Handler
Constructor Details
#initialize(configuration) ⇒ ListHandler
Returns a new instance of ListHandler.
6 7 8 9 10 11 12 |
# File 'lib/alx/list_handler.rb', line 6 def initialize( configuration ) super( :configuration => configuration, :command => 'list', :rest_description => 'pattern', :description => "Lists matching books in the library. Lists all if there's no pattern given." ) end |
Instance Method Details
#handle ⇒ Object
14 15 16 17 |
# File 'lib/alx/list_handler.rb', line 14 def handle load_library.list( @conf[ :rest ] ).each { | book | puts book.title } end |