class Hotel
Attributes
category[RW]
headline[RW]
hotel_name[RW]
hotel_url[RW]
hotel_website[RW]
location[RW]
notes[RW]
number_of_rooms[RW]
price[RW]
Public Class Methods
all()
click to toggle source
# File lib/best_boutique_hotels/hotel.rb, line 21 def self.all @@all end
create_from_collection(hotels_array)
click to toggle source
# File lib/best_boutique_hotels/hotel.rb, line 12 def self.create_from_collection(hotels_array) new_hotels = hotels_array.collect {|hotel| Hotel.new(hotel)} new_hotels end
new(hotel_details)
click to toggle source
# File lib/best_boutique_hotels/hotel.rb, line 7 def initialize(hotel_details) hotel_details.each {|key, value| self.send(("#{key}="), value)} self.class.all << self end
Public Instance Methods
add_hotel_attributes(attributes_hash)
click to toggle source
# File lib/best_boutique_hotels/hotel.rb, line 17 def add_hotel_attributes(attributes_hash) attributes_hash.each {|key, value| self.send(("#{key}="), value)} end