Class: Talkgh::Client
- Inherits:
-
Object
- Object
- Talkgh::Client
- Defined in:
- lib/talkgh/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #logger ⇒ Object
- #logger=(logger) ⇒ Object
- #sms ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 |
# File 'lib/talkgh/client.rb', line 5 def initialize( = {}) @api_token = [:api_token] || ENV['TALKGH_API_TOKEN'] self.logger = [:logger] || (defined?(Rails.logger) && Rails.logger) end |
Instance Attribute Details
#api_token ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/talkgh/client.rb', line 11 def api_token unless @api_token raise AuthenticationError.new('No API token provided. ' \ 'See https://talkgh.com for details.') end @api_token end |