Class: SimpleInvoice::Emailer::MailConfig

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/simple_invoice/emailer/mail_config.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMailConfig

Returns a new instance of MailConfig.



31
32
33
# File 'lib/simple_invoice/emailer/mail_config.rb', line 31

def initialize
  @config_hash = {}
end

Class Method Details

.email_from(email) ⇒ Object

Parameters:

  • email (String)


15
16
17
# File 'lib/simple_invoice/emailer/mail_config.rb', line 15

def email_from email
  instance[:email_from] = email
end

.email_subject(subject) ⇒ Object

Parameters:

  • subject (#call)


20
21
22
# File 'lib/simple_invoice/emailer/mail_config.rb', line 20

def email_subject subject
  instance[:email_subject] = subject
end

.instanceObject



10
11
12
# File 'lib/simple_invoice/emailer/mail_config.rb', line 10

def instance
  @instance ||= new
end

.organisation_name(name) ⇒ Object

Parameters:

  • name (String)


25
26
27
# File 'lib/simple_invoice/emailer/mail_config.rb', line 25

def organisation_name name
  instance[:organisation_name] = name
end

Instance Method Details

#[](key) ⇒ Object



35
36
37
# File 'lib/simple_invoice/emailer/mail_config.rb', line 35

def [](key)
  @config_hash[key]
end

#[]=(key, value) ⇒ Object



39
40
41
# File 'lib/simple_invoice/emailer/mail_config.rb', line 39

def []=(key, value)
  @config_hash[key] = value
end