Class: BigCommerce::ManagementAPI::Endpoint::Response

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/big_commerce/management_api/endpoint.rb

Overview

May go in its own file

Defined Under Namespace

Classes: Meta

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(headers, result = nil, meta = nil) ⇒ Response

Returns a new instance of Response.



135
136
137
138
139
# File 'lib/big_commerce/management_api/endpoint.rb', line 135

def initialize(headers, result = nil, meta = nil)
  @result = result || []
  @headers = ResponseHeaders.new(headers)
  @meta = Meta.new(meta) if meta
end

Instance Attribute Details

#headersObject (readonly)

Returns the value of attribute headers.



133
134
135
# File 'lib/big_commerce/management_api/endpoint.rb', line 133

def headers
  @headers
end

#metaObject (readonly)

Returns the value of attribute meta.



133
134
135
# File 'lib/big_commerce/management_api/endpoint.rb', line 133

def meta
  @meta
end

Instance Method Details

#each(&block) ⇒ Object



141
142
143
# File 'lib/big_commerce/management_api/endpoint.rb', line 141

def each(&block)
  @result.each(&block)
end