Class: AQI::Demographic
- Inherits:
-
Object
- Object
- AQI::Demographic
- Defined in:
- lib/aqi/demographic.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#date_of_birth ⇒ Object
Returns the value of attribute date_of_birth.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#postal_code ⇒ Object
Returns the value of attribute postal_code.
-
#race ⇒ Object
Returns the value of attribute race.
-
#state ⇒ Object
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(options) ⇒ Demographic
constructor
A new instance of Demographic.
- #to_xml ⇒ Object
Constructor Details
#initialize(options) ⇒ Demographic
Returns a new instance of Demographic.
5 6 7 8 9 10 11 12 |
# File 'lib/aqi/demographic.rb', line 5 def initialize() self.date_of_birth = [:date_of_birth] self.postal_code = [:postal_code] self.state = [:state] self.city = [:city] self.race = [:race] self.gender = [:gender] end |
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
3 4 5 |
# File 'lib/aqi/demographic.rb', line 3 def city @city end |
#date_of_birth ⇒ Object
Returns the value of attribute date_of_birth.
3 4 5 |
# File 'lib/aqi/demographic.rb', line 3 def date_of_birth @date_of_birth end |
#gender ⇒ Object
Returns the value of attribute gender.
3 4 5 |
# File 'lib/aqi/demographic.rb', line 3 def gender @gender end |
#postal_code ⇒ Object
Returns the value of attribute postal_code.
3 4 5 |
# File 'lib/aqi/demographic.rb', line 3 def postal_code @postal_code end |
#race ⇒ Object
Returns the value of attribute race.
3 4 5 |
# File 'lib/aqi/demographic.rb', line 3 def race @race end |
#state ⇒ Object
Returns the value of attribute state.
3 4 5 |
# File 'lib/aqi/demographic.rb', line 3 def state @state end |
Instance Method Details
#to_xml ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/aqi/demographic.rb', line 14 def to_xml builder = Builder::XmlMarkup.new builder.Demographic do |d| d.DOB(date_of_birth.strftime('%F')) if date_of_birth d.HomeZip(postal_code) d.HomeState(state) d.HomeCity(city) d.Race(race || 'UNKNOWN') d.Gender(gender) end end |