Class: Fetcher::Notion::Types::Response
- Inherits:
-
Object
- Object
- Fetcher::Notion::Types::Response
- Defined in:
- lib/bas/fetcher/notion/types/response.rb
Overview
Represents a response received from the Notion API. It encapsulates essential information about the response, providing a structured way to handle and analyze it’s responses.
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/bas/fetcher/notion/types/response.rb', line 12 def initialize(response) if response["results"].nil? @status_code = response["status"] @message = response["message"] @results = [] else @status_code = 200 @message = "success" @results = response["results"] end end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
10 11 12 |
# File 'lib/bas/fetcher/notion/types/response.rb', line 10 def @message end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
10 11 12 |
# File 'lib/bas/fetcher/notion/types/response.rb', line 10 def results @results end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
10 11 12 |
# File 'lib/bas/fetcher/notion/types/response.rb', line 10 def status_code @status_code end |