Class: RapidApi::ModelAdapters::QueryResult

Inherits:
Object
  • Object
show all
Defined in:
lib/rapid_api/model_adapters/query_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject

Returns the value of attribute data.



5
6
7
# File 'lib/rapid_api/model_adapters/query_result.rb', line 5

def data
  @data
end

#errorsObject

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

Returns:

  • (Boolean)


16
17
18
# File 'lib/rapid_api/model_adapters/query_result.rb', line 16

def found?
  data.present?
end

#has_errors?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/rapid_api/model_adapters/query_result.rb', line 12

def has_errors?
  errors.present?
end