Class: StoreCitySet

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ StoreCitySet

Returns a new instance of StoreCitySet.



5
6
7
8
# File 'lib/store_city_set.rb', line 5

def initialize(attributes) 
  @city = attributes[:city] 
  @state = attributes[:state]
end

Instance Attribute Details

#cityObject (readonly)

Returns the value of attribute city.



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

def city
  @city
end

#stateObject (readonly)

Returns the value of attribute state.



2
3
4
# File 'lib/store_city_set.rb', line 2

def state
  @state
end

Class Method Details

.from_xml(xml) ⇒ Object



10
11
12
13
# File 'lib/store_city_set.rb', line 10

def self.from_xml(xml) 
  new( :city => xml.css("City").text,
  :state => xml.css("State").text) 
end