Class: Render25::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/render25/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key = nil, options = {}) ⇒ Client

Returns a new instance of Client.



5
6
7
8
9
10
11
# File 'lib/render25/client.rb', line 5

def initialize(api_key = nil, options = {})
  @api_key = api_key || ENV['RENDER25_API_KEY']
  raise AuthenticationError, "Render25: API Key is required. Pass it to Render25.new(api_key) or set RENDER25_API_KEY environment variable." if @api_key.nil? || @api_key.empty?

  @base_url = (options[:base_url] || ENV['RENDER25_BASE_URL'] || "https://api.render25.com").sub(/\/+$/, '')
  @emails = Emails.new(self)
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



3
4
5
# File 'lib/render25/client.rb', line 3

def api_key
  @api_key
end

#base_urlObject (readonly)

Returns the value of attribute base_url.



3
4
5
# File 'lib/render25/client.rb', line 3

def base_url
  @base_url
end

#emailsObject (readonly)

Returns the value of attribute emails.



3
4
5
# File 'lib/render25/client.rb', line 3

def emails
  @emails
end