Class: StoreSet

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#addressObject (readonly)

Returns the value of attribute address.



4
5
6
# File 'lib/store_set.rb', line 4

def address
  @address
end

#cityObject (readonly)

Returns the value of attribute city.



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

def city
  @city
end

#phoneObject (readonly)

Returns the value of attribute phone.



8
9
10
# File 'lib/store_set.rb', line 8

def phone
  @phone
end

#stateObject (readonly)

Returns the value of attribute state.



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

def state
  @state
end

#store_nameObject (readonly)

Returns the value of attribute store_name.



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

def store_name
  @store_name
end

#storeidObject (readonly)

Returns the value of attribute storeid.



9
10
11
# File 'lib/store_set.rb', line 9

def storeid
  @storeid
end

#zipObject (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