Class: ArrayOfStoreCity
- Inherits:
-
Object
- Object
- ArrayOfStoreCity
- Defined in:
- lib/array_of_store_city.rb
Instance Attribute Summary collapse
-
#store_city_sets ⇒ Object
readonly
Returns the value of attribute store_city_sets.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(store_city_sets) ⇒ ArrayOfStoreCity
constructor
A new instance of ArrayOfStoreCity.
Constructor Details
#initialize(store_city_sets) ⇒ ArrayOfStoreCity
Returns a new instance of ArrayOfStoreCity.
5 6 7 |
# File 'lib/array_of_store_city.rb', line 5 def initialize(store_city_sets) @store_city_sets = store_city_sets end |
Instance Attribute Details
#store_city_sets ⇒ Object (readonly)
Returns the value of attribute store_city_sets.
4 5 6 |
# File 'lib/array_of_store_city.rb', line 4 def store_city_sets @store_city_sets end |
Class Method Details
.parse(xml) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/array_of_store_city.rb', line 9 def self.parse(xml) # debugger # doc = Nokogiri::XML(xml) sets = xml.css("ArrayOfStoreCity > StoreCity").map do |storecity| StoreCitySet.from_xml(storecity) end new(sets) end |