Class: PicturePath::Request
- Inherits:
-
Object
- Object
- PicturePath::Request
- Defined in:
- lib/picturepath/request.rb
Constant Summary collapse
- VERSION =
5.0- COUNTRY_US =
"US"
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#customer_number ⇒ Object
Returns the value of attribute customer_number.
-
#mls_id ⇒ Object
Returns the value of attribute mls_id.
-
#order_number ⇒ Object
Returns the value of attribute order_number.
-
#product_line ⇒ Object
Returns the value of attribute product_line.
-
#site_realtor ⇒ Object
Returns the value of attribute site_realtor.
-
#state ⇒ Object
Returns the value of attribute state.
-
#street1 ⇒ Object
Returns the value of attribute street1.
-
#street2 ⇒ Object
Returns the value of attribute street2.
-
#tour_url ⇒ Object
Returns the value of attribute tour_url.
-
#zip_code ⇒ Object
Returns the value of attribute zip_code.
Instance Method Summary collapse
-
#to_xml ⇒ Object
Create a valide XML request from the properties set on the request.
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
9 10 11 |
# File 'lib/picturepath/request.rb', line 9 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
9 10 11 |
# File 'lib/picturepath/request.rb', line 9 def country @country end |
#customer_number ⇒ Object
Returns the value of attribute customer_number.
9 10 11 |
# File 'lib/picturepath/request.rb', line 9 def customer_number @customer_number end |
#mls_id ⇒ Object
Returns the value of attribute mls_id.
9 10 11 |
# File 'lib/picturepath/request.rb', line 9 def mls_id @mls_id end |
#order_number ⇒ Object
Returns the value of attribute order_number.
9 10 11 |
# File 'lib/picturepath/request.rb', line 9 def order_number @order_number end |
#product_line ⇒ Object
Returns the value of attribute product_line.
9 10 11 |
# File 'lib/picturepath/request.rb', line 9 def product_line @product_line end |
#site_realtor ⇒ Object
Returns the value of attribute site_realtor.
9 10 11 |
# File 'lib/picturepath/request.rb', line 9 def site_realtor @site_realtor end |
#state ⇒ Object
Returns the value of attribute state.
9 10 11 |
# File 'lib/picturepath/request.rb', line 9 def state @state end |
#street1 ⇒ Object
Returns the value of attribute street1.
9 10 11 |
# File 'lib/picturepath/request.rb', line 9 def street1 @street1 end |
#street2 ⇒ Object
Returns the value of attribute street2.
9 10 11 |
# File 'lib/picturepath/request.rb', line 9 def street2 @street2 end |
#tour_url ⇒ Object
Returns the value of attribute tour_url.
9 10 11 |
# File 'lib/picturepath/request.rb', line 9 def tour_url @tour_url end |
#zip_code ⇒ Object
Returns the value of attribute zip_code.
9 10 11 |
# File 'lib/picturepath/request.rb', line 9 def zip_code @zip_code end |
Instance Method Details
#to_xml ⇒ Object
Create a valide XML request from the properties set on the request. Note: the PicturePath AUI requires capitalized tags
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/picturepath/request.rb', line 14 def to_xml output = "" x = Builder::XmlMarkup.new(:target => output, :indent => 1) x.instruct! x.AUI_SUBMISSION(:VERSION => VERSION) { x.TOUR { x.CUSTREFNUM customer_number (order_number != nil) && (x.ORDERNUM order_number) x.PRODUCT_LINE product_line x.ADDRESS { x.STREET1 street1 x.STREET2 street2 x.CITY city x.STATE state x.COUNTRY(:CODE => (country || COUNTRY_US)) x.ZIP zip_code } x.IDENTIFIERS { x.ID1(:VALUE => mls_id, :TYPE => "MLSID") } x.DISTRIBUTION { if site_realtor.class == Array site_realtor.each do |site| x.SITE site end else x.SITE site_realtor end } x.TOUR_URL tour_url } } return output end |