Class: GQLi::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/gqli/response.rb

Overview

Response object wrapper

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, errors, query) ⇒ Response

Returns a new instance of Response.



10
11
12
13
14
# File 'lib/gqli/response.rb', line 10

def initialize(data, errors, query)
  @data = Hashie::Mash.new(data)
  @errors = parse_errors(errors)
  @query = query
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



8
9
10
# File 'lib/gqli/response.rb', line 8

def data
  @data
end

#errorsObject (readonly)

Returns the value of attribute errors.



8
9
10
# File 'lib/gqli/response.rb', line 8

def errors
  @errors
end

#queryObject (readonly)

Returns the value of attribute query.



8
9
10
# File 'lib/gqli/response.rb', line 8

def query
  @query
end