Class: HotelBeds::HotelSearch::Response
Instance Attribute Summary
#body, #errors, #headers, #request
Instance Method Summary
collapse
#initialize, #inspect, #success?
Instance Method Details
#currency ⇒ Object
27
28
29
|
# File 'lib/hotel_beds/hotel_search/response.rb', line 27
def currency
body.at_css("Currency").attr("code")
end
|
#current_page ⇒ Object
11
12
13
14
15
16
17
|
# File 'lib/hotel_beds/hotel_search/response.rb', line 11
def current_page
if data =
Integer(data.attr("currentPage"))
else
0
end
end
|
#hotels ⇒ Object
31
32
33
34
35
|
# File 'lib/hotel_beds/hotel_search/response.rb', line 31
def hotels
body.css("ServiceHotel").lazy.map do |hotel|
HotelBeds::Parser::Hotel.new(hotel).to_model
end
end
|
#session_id ⇒ Object
7
8
9
|
# File 'lib/hotel_beds/hotel_search/response.rb', line 7
def session_id
request.session_id
end
|
#total_pages ⇒ Object
19
20
21
22
23
24
25
|
# File 'lib/hotel_beds/hotel_search/response.rb', line 19
def total_pages
if data =
Integer(data.attr("totalPages"))
else
0
end
end
|