Class: IletimerkeziSdk::Responses::BlacklistResponse
- Inherits:
-
BaseResponse
- Object
- BaseResponse
- IletimerkeziSdk::Responses::BlacklistResponse
- Includes:
- Enumerable
- Defined in:
- lib/iletimerkezi_sdk/responses/blacklist_response.rb
Instance Attribute Summary
Attributes inherited from BaseResponse
Instance Method Summary collapse
- #count ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(response_body, http_status_code) ⇒ BlacklistResponse
constructor
A new instance of BlacklistResponse.
- #numbers ⇒ Object
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
#count ⇒ Object
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 |
#numbers ⇒ Object
20 21 22 |
# File 'lib/iletimerkezi_sdk/responses/blacklist_response.rb', line 20 def numbers @numbers end |