Class: ShopifyApiBruv::Resources::Graphql::ResourceResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/shopify_api_bruv/resources/graphql/resource_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body:, query:) ⇒ ResourceResponse

Returns a new instance of ResourceResponse.



9
10
11
# File 'lib/shopify_api_bruv/resources/graphql/resource_response.rb', line 9

def initialize(body:, query:)
  parse_body(body:, query:)
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



7
8
9
# File 'lib/shopify_api_bruv/resources/graphql/resource_response.rb', line 7

def data
  @data
end

#extensionsObject

Returns the value of attribute extensions.



7
8
9
# File 'lib/shopify_api_bruv/resources/graphql/resource_response.rb', line 7

def extensions
  @extensions
end

#throttle_statusObject

Returns the value of attribute throttle_status.



7
8
9
# File 'lib/shopify_api_bruv/resources/graphql/resource_response.rb', line 7

def throttle_status
  @throttle_status
end

Instance Method Details

#as_open_structObject



13
14
15
16
17
# File 'lib/shopify_api_bruv/resources/graphql/resource_response.rb', line 13

def as_open_struct
  # rubocop:disable Style/OpenStructUse
  JSON.parse(data.to_json, object_class: OpenStruct)
  # rubocop:enable Style/OpenStructUse
end