Class: IletimerkeziSdk::Client
- Inherits:
-
Object
- Object
- IletimerkeziSdk::Client
- Defined in:
- lib/iletimerkezi_sdk/client.rb
Instance Attribute Summary collapse
-
#http_client ⇒ Object
readonly
Returns the value of attribute http_client.
Instance Method Summary collapse
- #account ⇒ Object
- #blacklist ⇒ Object
- #debug ⇒ Object
-
#initialize(api_key, api_hash, default_sender = nil, http_client = nil) ⇒ Client
constructor
A new instance of Client.
- #report ⇒ Object
- #sender ⇒ Object
- #sms ⇒ Object
- #summary ⇒ Object
- #webhook ⇒ Object
Constructor Details
#initialize(api_key, api_hash, default_sender = nil, http_client = nil) ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 10 |
# File 'lib/iletimerkezi_sdk/client.rb', line 5 def initialize(api_key, api_hash, default_sender = nil, http_client = nil) @api_key = api_key @api_hash = api_hash @default_sender = default_sender @http_client = http_client || default_http_client end |
Instance Attribute Details
#http_client ⇒ Object (readonly)
Returns the value of attribute http_client.
3 4 5 |
# File 'lib/iletimerkezi_sdk/client.rb', line 3 def http_client @http_client end |
Instance Method Details
#account ⇒ Object
16 17 18 |
# File 'lib/iletimerkezi_sdk/client.rb', line 16 def account @account ||= Services::AccountService.new(@http_client, @api_key, @api_hash) end |
#blacklist ⇒ Object
32 33 34 |
# File 'lib/iletimerkezi_sdk/client.rb', line 32 def blacklist @blacklist ||= Services::BlacklistService.new(@http_client, @api_key, @api_hash) end |
#debug ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/iletimerkezi_sdk/client.rb', line 40 def debug JSON.pretty_generate({ payload: JSON.parse(@http_client.get_payload), response: JSON.parse(@http_client.get_body), status: @http_client.get_status_code }) end |
#report ⇒ Object
20 21 22 |
# File 'lib/iletimerkezi_sdk/client.rb', line 20 def report @report ||= Services::ReportService.new(@http_client, @api_key, @api_hash) end |
#sender ⇒ Object
28 29 30 |
# File 'lib/iletimerkezi_sdk/client.rb', line 28 def sender @sender ||= Services::SenderService.new(@http_client, @api_key, @api_hash) end |
#sms ⇒ Object
12 13 14 |
# File 'lib/iletimerkezi_sdk/client.rb', line 12 def sms @sms ||= Services::SmsService.new(@http_client, @api_key, @api_hash, @default_sender) end |
#summary ⇒ Object
24 25 26 |
# File 'lib/iletimerkezi_sdk/client.rb', line 24 def summary @summary ||= Services::SummaryService.new(@http_client, @api_key, @api_hash) end |
#webhook ⇒ Object
36 37 38 |
# File 'lib/iletimerkezi_sdk/client.rb', line 36 def webhook @webhook ||= Services::WebhookService.new end |