Class: TripAdvisorBest::Place

Inherits:
Object
  • Object
show all
Defined in:
lib/tripadvisor_best/place.rb

Direct Known Subclasses

Attraction, Landmark, Museum

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Place

Returns a new instance of Place.



3
4
5
# File 'lib/tripadvisor_best/place.rb', line 3

def initialize(attributes)
  attributes.each{|k, v| self.send(("#{k}="), v)}
end

Class Method Details

.create_from_collection(museums_array) ⇒ Object



7
8
9
# File 'lib/tripadvisor_best/place.rb', line 7

def self.create_from_collection(museums_array)
  museums_array.each{|museum| self.new(museum)}
end

Instance Method Details

#add_highlight_attributes(attributes) ⇒ Object



11
12
13
# File 'lib/tripadvisor_best/place.rb', line 11

def add_highlight_attributes(attributes)
  attributes.each{|k, v| self.send(("#{k}="), v)}
end