Class: Ppl::Command::Name
- Inherits:
-
Application::Command
- Object
- Application::Command
- Ppl::Command::Name
- Defined in:
- lib/ppl/command/name.rb
Instance Attribute Summary collapse
-
#list_format ⇒ Object
writeonly
Sets the attribute list_format.
-
#name_service ⇒ Object
writeonly
Sets the attribute name_service.
-
#show_format ⇒ Object
writeonly
Sets the attribute show_format.
Attributes inherited from Application::Command
Instance Method Summary collapse
Methods inherited from Application::Command
Instance Attribute Details
#list_format=(value) ⇒ Object (writeonly)
Sets the attribute list_format
7 8 9 |
# File 'lib/ppl/command/name.rb', line 7 def list_format=(value) @list_format = value end |
#name_service=(value) ⇒ Object (writeonly)
Sets the attribute name_service
8 9 10 |
# File 'lib/ppl/command/name.rb', line 8 def name_service=(value) @name_service = value end |
#show_format=(value) ⇒ Object (writeonly)
Sets the attribute show_format
6 7 8 |
# File 'lib/ppl/command/name.rb', line 6 def show_format=(value) @show_format = value end |
Instance Method Details
#execute(input, output) ⇒ Object
29 30 31 32 |
# File 'lib/ppl/command/name.rb', line 29 def execute(input, output) action = determine_action(input) send(action, input, output) end |
#options(parser, options) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/ppl/command/name.rb', line 10 def (parser, ) parser. = "usage: ppl name <contact> [<name>]" parser.on("-f", "--family <family-name(s)>") do |family| [:family] = family end parser.on("-g", "--given <given-name(s)>") do |given| [:given] = given end parser.on("-m", "--middle <middle-name(s)>") do |middle| [:middle] = middle end parser.on("-p", "--prefix <prefix>") do |prefix| [:prefix] = prefix end parser.on("-s", "--suffix <suffix>") do |suffix| [:suffix] = suffix end end |