Module: BookingSync::API::Client::NightlyRateMaps

Included in:
BookingSync::API::Client
Defined in:
lib/bookingsync/api/client/nightly_rate_maps.rb

Instance Method Summary collapse

Instance Method Details

#edit_nightly_rate_map(nightly_rate_map, options = {}) ⇒ BookingSync::API::Resource

Edit a nightly_rate_map

Examples:

nightly_rate_map = @api.nightly_rate_maps.first
@api.edit_nightly_rate_map(nightly_rate_map, { rates_map: "10,10,10,0..." })

Parameters:

  • nightly_rate_map (BookingSync::API::Resource|Integer)

    NightlyRateMap or ID of the nightly_rate_map to be updated.

  • options (Hash) (defaults to: {})

    NightlyRateMap attributes to be updated.

Returns:



38
39
40
# File 'lib/bookingsync/api/client/nightly_rate_maps.rb', line 38

def edit_nightly_rate_map(nightly_rate_map, options = {})
  put("nightly_rate_maps/#{nightly_rate_map}", nightly_rate_maps: [options]).pop
end

#nightly_rate_map(nightly_rate_map) ⇒ BookingSync::API::Resource

Get a single nightly_rate_map

Parameters:

Returns:



24
25
26
# File 'lib/bookingsync/api/client/nightly_rate_maps.rb', line 24

def nightly_rate_map(nightly_rate_map)
  get("nightly_rate_maps/#{nightly_rate_map}").pop
end

#nightly_rate_maps(options = {}, &block) ⇒ Array<BookingSync::API::Resource>

List nightly_rate_maps

Returns nightly_rate_maps for the rentals of the account, user is authenticated with.

Examples:

Get the list of nightly_rate_maps for the current account

nightly_rate_maps = @api.nightly_rate_maps
nightly_rate_maps.first.start_date # => "2014-05-30"

Parameters:

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • fields: (Array)

    List of fields to be fetched.

Returns:

See Also:



15
16
17
# File 'lib/bookingsync/api/client/nightly_rate_maps.rb', line 15

def nightly_rate_maps(options = {}, &block)
  paginate :nightly_rate_maps, options, &block
end