Class: Nineflats::Prices

Inherits:
Base
  • Object
show all
Defined in:
lib/nineflats-api/prices.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#raw_data

Instance Method Summary collapse

Methods inherited from Base

client_app_key, client_app_key=, object_link

Constructor Details

#initialize(prices) ⇒ Prices

Returns a new instance of Prices.



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/nineflats-api/prices.rb', line 7

def initialize(prices)
  @raw_data = prices
  @currency                    = prices["currency"]
  @default_price               = prices["default_price"]
  @weekend_night_price         = prices["weekend_night_price"]
  @weekly_discount_in_percent  = prices["weekly_discount_in_percent"]
  @monthly_discount_in_percent = prices["monthly_discount_in_percent"]

  @seasons = prices["seasons"].collect do |season|
    Season.new(season)
  end
end

Instance Attribute Details

#currencyObject

Returns the value of attribute currency.



3
4
5
# File 'lib/nineflats-api/prices.rb', line 3

def currency
  @currency
end

#default_priceObject

Returns the value of attribute default_price.



3
4
5
# File 'lib/nineflats-api/prices.rb', line 3

def default_price
  @default_price
end

#monthly_discount_in_percentObject

Returns the value of attribute monthly_discount_in_percent.



3
4
5
# File 'lib/nineflats-api/prices.rb', line 3

def monthly_discount_in_percent
  @monthly_discount_in_percent
end

#seasonsObject

Returns the value of attribute seasons.



3
4
5
# File 'lib/nineflats-api/prices.rb', line 3

def seasons
  @seasons
end

#weekend_night_priceObject

Returns the value of attribute weekend_night_price.



3
4
5
# File 'lib/nineflats-api/prices.rb', line 3

def weekend_night_price
  @weekend_night_price
end

#weekly_discount_in_percentObject

Returns the value of attribute weekly_discount_in_percent.



3
4
5
# File 'lib/nineflats-api/prices.rb', line 3

def weekly_discount_in_percent
  @weekly_discount_in_percent
end