Class: StoreCitySet
- Inherits:
-
Object
- Object
- StoreCitySet
- Defined in:
- lib/store_city_set.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ StoreCitySet
constructor
A new instance of StoreCitySet.
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
#city ⇒ Object (readonly)
Returns the value of attribute city.
3 4 5 |
# File 'lib/store_city_set.rb', line 3 def city @city end |
#state ⇒ Object (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 |