Class: IletimerkeziSdk::Responses::BlacklistResponse

Inherits:
BaseResponse
  • Object
show all
Includes:
Enumerable
Defined in:
lib/iletimerkezi_sdk/responses/blacklist_response.rb

Instance Attribute Summary

Attributes inherited from BaseResponse

#data, #message, #status_code

Instance Method Summary collapse

Methods inherited from BaseResponse

#get_data, #get_message, #get_status_code, #ok?

Constructor Details

#initialize(response_body, http_status_code) ⇒ BlacklistResponse

Returns a new instance of BlacklistResponse.



6
7
8
9
10
# File 'lib/iletimerkezi_sdk/responses/blacklist_response.rb', line 6

def initialize(response_body, http_status_code)
  @numbers = []
  @position = 0
  super(response_body, http_status_code)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class IletimerkeziSdk::Responses::BaseResponse

Instance Method Details

#countObject



16
17
18
# File 'lib/iletimerkezi_sdk/responses/blacklist_response.rb', line 16

def count
  (@data.dig('blacklist', 'count') || 0).to_i
end

#each(&block) ⇒ Object



12
13
14
# File 'lib/iletimerkezi_sdk/responses/blacklist_response.rb', line 12

def each(&block)
  @numbers.each(&block)
end

#numbersObject



20
21
22
# File 'lib/iletimerkezi_sdk/responses/blacklist_response.rb', line 20

def numbers
  @numbers
end