Class: Ppl::Command::Email

Inherits:
Application::Command show all
Defined in:
lib/ppl/command/email.rb

Instance Attribute Summary collapse

Attributes inherited from Application::Command

#description, #name, #storage

Instance Method Summary collapse

Constructor Details

#initializeEmail

Returns a new instance of Email.



7
8
9
10
11
12
# File 'lib/ppl/command/email.rb', line 7

def initialize
  @name        = "email"
  @description = "Show or change a contact's email address"
  @show_format = Ppl::Format::Contact::EmailAddresses.new
  @list_format = Ppl::Format::AddressBook::EmailAddresses.new
end

Instance Attribute Details

#list_format=(value) ⇒ Object (writeonly)

Sets the attribute list_format

Parameters:

  • value

    the value to set the attribute list_format to.



5
6
7
# File 'lib/ppl/command/email.rb', line 5

def list_format=(value)
  @list_format = value
end

#show_format=(value) ⇒ Object (writeonly)

Sets the attribute show_format

Parameters:

  • value

    the value to set the attribute show_format to.



4
5
6
# File 'lib/ppl/command/email.rb', line 4

def show_format=(value)
  @show_format = value
end

Instance Method Details

#execute(input, output) ⇒ Object



18
19
20
21
# File 'lib/ppl/command/email.rb', line 18

def execute(input, output)
  action = determine_action(input)
  send(action, input, output)
end

#options(parser, options) ⇒ Object



14
15
16
# File 'lib/ppl/command/email.rb', line 14

def options(parser, options)
  parser.banner = "usage: ppl email <contact> [<email-address>]"
end