Class: UniSender::Client
- Inherits:
-
Object
- Object
- UniSender::Client
- Defined in:
- lib/uni_sender.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#locale ⇒ Object
Returns the value of attribute locale.
Instance Method Summary collapse
-
#initialize(api_key, locale = nil) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(api_key, locale = nil) ⇒ Client
Returns a new instance of Client.
10 11 12 13 14 15 16 17 18 |
# File 'lib/uni_sender.rb', line 10 def initialize(api_key, locale = nil) self.api_key = api_key if locale.is_a?(Hash) puts "Deprecated: Initializer changed. Use UniSender::Client.new(api_key, [locale])" locale = locale[:locale] end self.locale = locale if locale end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object (private)
26 27 28 29 |
# File 'lib/uni_sender.rb', line 26 def method_missing(method_name, *args, &block) params = (args.first.is_a?(Hash) ? args.first : {} ) default_request(prepare_action_name(method_name), params) end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
8 9 10 |
# File 'lib/uni_sender.rb', line 8 def api_key @api_key end |
#locale ⇒ Object
Returns the value of attribute locale.
8 9 10 |
# File 'lib/uni_sender.rb', line 8 def locale @locale end |