Class: Render25::Client
- Inherits:
-
Object
- Object
- Render25::Client
- Defined in:
- lib/render25/client.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#emails ⇒ Object
readonly
Returns the value of attribute emails.
Instance Method Summary collapse
-
#initialize(api_key = nil, options = {}) ⇒ Client
constructor
A new instance of Client.
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, = {}) @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 = ([:base_url] || ENV['RENDER25_BASE_URL'] || "https://api.render25.com").sub(/\/+$/, '') @emails = Emails.new(self) end |
Instance Attribute Details
#api_key ⇒ Object (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_url ⇒ Object (readonly)
Returns the value of attribute base_url.
3 4 5 |
# File 'lib/render25/client.rb', line 3 def base_url @base_url end |
#emails ⇒ Object (readonly)
Returns the value of attribute emails.
3 4 5 |
# File 'lib/render25/client.rb', line 3 def emails @emails end |