Class: Yogurt::Query

Inherits:
Object
  • Object
show all
Extended by:
T::Helpers, T::Sig
Defined in:
lib/yogurt/query.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, errors) ⇒ Query

Returns a new instance of Query.



21
# File 'lib/yogurt/query.rb', line 21

def initialize(data, errors); end

Class Method Details

.from_result(result) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/yogurt/query.rb', line 11

def self.from_result(result)
  data = result['data']
  if data
    new(data, result['errors'])
  else
    Yogurt::ErrorResult::OnlyErrors.new(result['errors'])
  end
end