class BookingApi::Images::Image

Attributes

raw_data[R]

Public Class Methods

new(raw_data = {}) click to toggle source
# File lib/booking_api/images/image.rb, line 7
def initialize(raw_data = {})
  @raw_data = raw_data.with_indifferent_access
end

Public Instance Methods

hotel_id() click to toggle source
# File lib/booking_api/images/image.rb, line 11
def hotel_id
  @raw_data[:hotel_id].to_i
end
is_default_image?() click to toggle source
# File lib/booking_api/images/image.rb, line 26
def is_default_image?
  @raw_data[:descriptiontype_id].to_i == 10
end
largest_file_url() click to toggle source

returns the largest file url for the image

available sizes include: 840x460 and 1280x900

# File lib/booking_api/images/image.rb, line 22
def largest_file_url
  @raw_data[:url_original].gsub("max500", "max1280x900")
end
photo_id() click to toggle source
# File lib/booking_api/images/image.rb, line 15
def photo_id
  @raw_data[:photo_id].to_i
end