Class: Airbnb::RentInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/Time_Traveler/rentInfo.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rooms, info) ⇒ RentInfo

Returns a new instance of RentInfo.



8
9
10
11
12
13
# File 'lib/Time_Traveler/rentInfo.rb', line 8

def initialize(rooms,info)
  @infos = rooms.map { |item|
    rooms = room(item)
  }
  searchVal(info)
end

Instance Attribute Details

#infosObject (readonly)

Returns the value of attribute infos.



6
7
8
# File 'lib/Time_Traveler/rentInfo.rb', line 6

def infos
  @infos
end

#locationObject (readonly)

Returns the value of attribute location.



5
6
7
# File 'lib/Time_Traveler/rentInfo.rb', line 5

def location
  @location
end

Class Method Details

.find(location:) ⇒ Object



19
20
21
22
23
# File 'lib/Time_Traveler/rentInfo.rb', line 19

def self.find(location:)
  @search_info = {api:ENV['AIRBNB_API'],locate:location}
  rooms_data = AirbnbApi.rooms_info(location)
  new(rooms_data,@search_info)
end