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.
-
#client_ip ⇒ Object
Returns the value of attribute client_ip.
-
#locale ⇒ Object
Returns the value of attribute locale.
Instance Method Summary collapse
-
#initialize(api_key, params = {}) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(api_key, params = {}) ⇒ Client
Returns a new instance of Client.
12 13 14 15 16 17 18 19 |
# File 'lib/uni_sender.rb', line 12 def initialize(api_key, params={}) self.api_key = api_key params.each do |key, value| if defined?("#{key}=") self.send("#{key}=", value) end end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(undefined_action, *args, &block) ⇒ Object (private)
46 47 48 49 |
# File 'lib/uni_sender.rb', line 46 def method_missing(undefined_action, *args, &block) params = (args.first.is_a?(Hash) ? args.first : {} ) default_request(undefined_action.to_s.camelize(false), params) end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
10 11 12 |
# File 'lib/uni_sender.rb', line 10 def api_key @api_key end |
#client_ip ⇒ Object
Returns the value of attribute client_ip.
10 11 12 |
# File 'lib/uni_sender.rb', line 10 def client_ip @client_ip end |
#locale ⇒ Object
Returns the value of attribute locale.
10 11 12 |
# File 'lib/uni_sender.rb', line 10 def locale @locale end |