class Levelup::Requests::ListLocations

Represents a request to list all locations under a specified merchant. This is a v14 endpoint and should not be expected to remain functional indefinitely.

Public Instance Methods

auth_type() click to toggle source
# File lib/levelup/requests/list_locations.rb, line 8
def auth_type
  :merchant_v14
end
response_from_hash(hash) click to toggle source
# File lib/levelup/requests/list_locations.rb, line 12
def response_from_hash(hash)
  if hash.nil? # no locations found for this merchant
    Responses::Success.new(locations: [])
  else
    locations =
      hash.map { |location| OpenStruct.new(location['location']) }
    Responses::Success.new(locations: locations)
  end
end