Class: Mailgun::Connector

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/howitzer/mailgun/connector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key


9
10
11
# File 'lib/howitzer/mailgun/connector.rb', line 9

def api_key
  @api_key
end

Instance Method Details

#change_domain(domain_name = settings.mailgun_domain) ⇒ Object


25
26
27
# File 'lib/howitzer/mailgun/connector.rb', line 25

def change_domain(domain_name=settings.mailgun_domain)
  @domain = domain_name
end

#client(api_key = settings.mailgun_key) ⇒ Object


11
12
13
14
15
16
17
18
19
# File 'lib/howitzer/mailgun/connector.rb', line 11

def client(api_key=settings.mailgun_key)
  check_api_key(api_key)
  if @api_key == api_key && @api_key
    @client
  else
    @api_key = api_key
    @client = Mailgun::Client.new(@api_key)
  end
end

#domainObject


21
22
23
# File 'lib/howitzer/mailgun/connector.rb', line 21

def domain
  @domain || change_domain
end