Class: Ppl::Command::Email
- Inherits:
-
Application::Command
- Object
- Application::Command
- Ppl::Command::Email
- Defined in:
- lib/ppl/command/email.rb
Instance Attribute Summary collapse
-
#custom_format ⇒ Object
writeonly
Sets the attribute custom_format.
-
#email_service ⇒ Object
writeonly
Sets the attribute email_service.
-
#list_format ⇒ Object
writeonly
Sets the attribute list_format.
-
#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
#custom_format=(value) ⇒ Object (writeonly)
Sets the attribute custom_format
9 10 11 |
# File 'lib/ppl/command/email.rb', line 9 def custom_format=(value) @custom_format = value end |
#email_service=(value) ⇒ Object (writeonly)
Sets the attribute email_service
6 7 8 |
# File 'lib/ppl/command/email.rb', line 6 def email_service=(value) @email_service = value end |
#list_format=(value) ⇒ Object (writeonly)
Sets the attribute list_format
7 8 9 |
# File 'lib/ppl/command/email.rb', line 7 def list_format=(value) @list_format = value end |
#show_format=(value) ⇒ Object (writeonly)
Sets the attribute show_format
8 9 10 |
# File 'lib/ppl/command/email.rb', line 8 def show_format=(value) @show_format = value end |
Instance Method Details
#execute(input, output) ⇒ Object
27 28 29 30 31 |
# File 'lib/ppl/command/email.rb', line 27 def execute(input, output) action = determine_action(input) send(action, input, output) true end |
#options(parser, options) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ppl/command/email.rb', line 11 def (parser, ) parser. = "usage: ppl email <contact> [<email-address>]" parser.on("-d", "--delete", "delete email address") do [:delete] = true end parser.on("-p", "--preferred", "mark address as preferred") do [:preferred] = true end parser.on("-P", "--not-preferred", "mark address as not preferred") do [:preferred] = false end parser.on("--format <format>", "specify a custom output format") do |f| [:format] = f end end |