Class: StoreSet
- Inherits:
-
Object
- Object
- StoreSet
- Defined in:
- lib/store_set.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#store_name ⇒ Object
readonly
Returns the value of attribute store_name.
-
#storeid ⇒ Object
readonly
Returns the value of attribute storeid.
-
#zip ⇒ Object
readonly
Returns the value of attribute zip.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ StoreSet
constructor
A new instance of StoreSet.
Constructor Details
#initialize(attributes) ⇒ StoreSet
Returns a new instance of StoreSet.
11 12 13 14 15 16 17 18 19 |
# File 'lib/store_set.rb', line 11 def initialize(attributes) @store_name = attributes[:store_name] @address = attributes[:address] @city = attributes[:city] @state = attributes[:state] @zip = attributes[:zip] @phone = attributes[:phone] @storeid = attributes[:storeid] end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
4 5 6 |
# File 'lib/store_set.rb', line 4 def address @address end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
5 6 7 |
# File 'lib/store_set.rb', line 5 def city @city end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
8 9 10 |
# File 'lib/store_set.rb', line 8 def phone @phone end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
6 7 8 |
# File 'lib/store_set.rb', line 6 def state @state end |
#store_name ⇒ Object (readonly)
Returns the value of attribute store_name.
3 4 5 |
# File 'lib/store_set.rb', line 3 def store_name @store_name end |
#storeid ⇒ Object (readonly)
Returns the value of attribute storeid.
9 10 11 |
# File 'lib/store_set.rb', line 9 def storeid @storeid end |
#zip ⇒ Object (readonly)
Returns the value of attribute zip.
7 8 9 |
# File 'lib/store_set.rb', line 7 def zip @zip end |
Class Method Details
.from_xml(xml) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/store_set.rb', line 21 def self.from_xml(xml) new( :store_name => xml.css("Storename").text, :address => xml.css("Address").text, :city => xml.css("City").text, :state => xml.css("State").text, :zip => xml.css("Zip").text, :phone => xml.css("Phone").text, :storeid => xml.css("StoreId").text) end |