Class: Levelup::Requests::CreateAddress

Inherits:
Base show all
Includes:
Templates::UserAddressData, Templates::UserAuthenticated
Defined in:
lib/levelup/requests/create_address.rb

Overview

Represents a request to create an address for a specific user. For information about its parameters, see UserAddressData and UserAuthenticated.

Constant Summary

Constants inherited from Base

Base::ALLOWED_REQUEST_METHODS

Instance Attribute Summary

Attributes included from Templates::UserAuthenticated

#user_access_token

Attributes included from Templates::UserAddressData

#address_type, #extended_address, #locality, #postal_code, #region, #street_address

Instance Method Summary collapse

Methods included from Templates::UserAuthenticated

#auth_type

Methods inherited from Base

#auth_type, #headers, instance_variables_excluded_from_hash, #send_to_api

Methods inherited from Templates::DataParcel

excluded?, #initialize, instance_variables_excluded_from_hash

Constructor Details

This class inherits a constructor from Levelup::Templates::DataParcel

Instance Method Details

#bodyObject


9
10
11
# File 'lib/levelup/requests/create_address.rb', line 9

def body
  { user_address: to_hash }
end

#response_from_hash(hash) ⇒ Object


13
14
15
# File 'lib/levelup/requests/create_address.rb', line 13

def response_from_hash(hash)
  Responses::Success.new(hash['user_address'])
end