Class: RapidApi::ModelAdapters::QueryResult
- Inherits:
-
Object
- Object
- RapidApi::ModelAdapters::QueryResult
- Defined in:
- lib/rapid_api/model_adapters/query_result.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#errors ⇒ Object
Returns the value of attribute errors.
Instance Method Summary collapse
- #found? ⇒ Boolean
- #has_errors? ⇒ Boolean
-
#initialize(data: nil, errors: nil) ⇒ QueryResult
constructor
A new instance of QueryResult.
Constructor Details
#initialize(data: nil, errors: nil) ⇒ QueryResult
Returns a new instance of QueryResult.
7 8 9 10 |
# File 'lib/rapid_api/model_adapters/query_result.rb', line 7 def initialize(data: nil, errors: nil) @data = data @errors = errors end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/rapid_api/model_adapters/query_result.rb', line 5 def data @data end |
#errors ⇒ Object
Returns the value of attribute errors.
5 6 7 |
# File 'lib/rapid_api/model_adapters/query_result.rb', line 5 def errors @errors end |
Instance Method Details
#found? ⇒ Boolean
16 17 18 |
# File 'lib/rapid_api/model_adapters/query_result.rb', line 16 def found? data.present? end |
#has_errors? ⇒ Boolean
12 13 14 |
# File 'lib/rapid_api/model_adapters/query_result.rb', line 12 def has_errors? errors.present? end |