Class: Ppl::Command::Ls
- Inherits:
-
Application::Command
- Object
- Application::Command
- Ppl::Command::Ls
- Defined in:
- lib/ppl/command/ls.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
writeonly
Sets the attribute format.
Attributes inherited from Application::Command
Instance Method Summary collapse
- #execute(input, output) ⇒ Object
-
#initialize ⇒ Ls
constructor
A new instance of Ls.
- #options(parser, options) ⇒ Object
Constructor Details
Instance Attribute Details
#format=(value) ⇒ Object (writeonly)
Sets the attribute format
4 5 6 |
# File 'lib/ppl/command/ls.rb', line 4 def format=(value) @format = value end |
Instance Method Details
#execute(input, output) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/ppl/command/ls.rb', line 17 def execute(input, output) address_book = @storage.load_address_book formatted = @format.process(address_book) output.line(formatted) return true end |
#options(parser, options) ⇒ Object
13 14 15 |
# File 'lib/ppl/command/ls.rb', line 13 def (parser, ) parser. = "usage: ppl ls" end |