Class: Nineflats::Prices
Instance Attribute Summary collapse
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#default_price ⇒ Object
Returns the value of attribute default_price.
-
#monthly_discount_in_percent ⇒ Object
Returns the value of attribute monthly_discount_in_percent.
-
#seasons ⇒ Object
Returns the value of attribute seasons.
-
#weekend_night_price ⇒ Object
Returns the value of attribute weekend_night_price.
-
#weekly_discount_in_percent ⇒ Object
Returns the value of attribute weekly_discount_in_percent.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(json) ⇒ Prices
constructor
A new instance of Prices.
Methods inherited from Base
base_url, client_app_key, client_app_key=, object_link
Constructor Details
#initialize(json) ⇒ Prices
Returns a new instance of Prices.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/nineflats-api/prices.rb', line 7 def initialize(json) prices = json.first[1] @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
#currency ⇒ Object
Returns the value of attribute currency.
3 4 5 |
# File 'lib/nineflats-api/prices.rb', line 3 def currency @currency end |
#default_price ⇒ Object
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_percent ⇒ Object
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 |
#seasons ⇒ Object
Returns the value of attribute seasons.
3 4 5 |
# File 'lib/nineflats-api/prices.rb', line 3 def seasons @seasons end |
#weekend_night_price ⇒ Object
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_percent ⇒ Object
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 |
Class Method Details
.api_call(slug) ⇒ Object
21 22 23 |
# File 'lib/nineflats-api/prices.rb', line 21 def self.api_call(slug) base_url + "/places/#{slug}/prices?client_id=#{Nineflats::Base.client_app_key}" end |