Class: Redwood::Account

Inherits:
Person show all
Defined in:
lib/sup/account.rb

Instance Attribute Summary collapse

Attributes inherited from Person

#email, #name

Instance Method Summary collapse

Methods inherited from Person

#eql?, from_address, from_address_list, from_name_and_email, full_address, #full_address, #hash, #indexable_content, #longname, #mediumname, #shortname, #sort_by_me, #to_s

Constructor Details

#initialize(h) ⇒ Account

Returns a new instance of Account.

Raises:

  • (ArgumentError)


6
7
8
9
10
11
12
13
# File 'lib/sup/account.rb', line 6

def initialize h
  raise ArgumentError, "no name for account" unless h[:name]
  raise ArgumentError, "no email for account" unless h[:email]
  super h[:name], h[:email]
  @sendmail = h[:sendmail]
  @signature = h[:signature]
  @gpgkey = h[:gpgkey]
end

Instance Attribute Details

#gpgkeyObject

Returns the value of attribute gpgkey.



4
5
6
# File 'lib/sup/account.rb', line 4

def gpgkey
  @gpgkey
end

#sendmailObject

Returns the value of attribute sendmail.



4
5
6
# File 'lib/sup/account.rb', line 4

def sendmail
  @sendmail
end

#signatureObject

Returns the value of attribute signature.



4
5
6
# File 'lib/sup/account.rb', line 4

def signature
  @signature
end

Instance Method Details

#bounce_sendmailObject

Default sendmail command for bouncing mail, deduced from #sendmail



17
18
19
20
21
22
23
24
# File 'lib/sup/account.rb', line 17

def bounce_sendmail
  sendmail.sub(/\s(\-(ti|it|t))\b/) do |match|
    case $1
    when '-t' then ''
    else ' -i'
    end
  end
end