Sha256: f0c2a13e6c98a61d9492f2fa1cbfb3e1f307737da74ec5931f57d1cb1f751da6

Contents?: true

Size: 1.06 KB

Versions: 60

Compression:

Stored size: 1.06 KB

Contents

# This class is just an intermediate for representing potential event occurences.
class Caren::Store::Address < Caren::Base

  def self.keys
    [ :full_name,                 # String
      :address_line_1,            # String
      :address_line_2,            # String
      :city,                      # String
      :state_province_or_region,  # String
      :zip,                       # String
      :country,                   # String
      :purpose,                   # String (shipping or billing)
    ]
  end

  def self.array_root
   :addresses
  end

  def as_xml
    {
      :full_name => self.full_name,
      :address_line_1 => self.address_line_1,
      :address_line_2 => self.address_line_2,
      :city => self.city,
      :state_province_or_region => self.state_province_or_region,
      :zip => self.zip,
      :country => self.country
    }
  end

  def node_root
    case self.purpose
    when "shipping"
      :shipping_address
    when "billing"
      :billing_address
    else
      self.class.node_root
    end
  end

  def self.node_root
   :address
  end

end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
caren-api-0.12.5 lib/caren/store/address.rb
caren-api-0.12.4 lib/caren/store/address.rb
caren-api-0.12.3 lib/caren/store/address.rb
caren-api-0.12.2 lib/caren/store/address.rb
caren-api-0.12.1 lib/caren/store/address.rb
caren-api-0.12.0 lib/caren/store/address.rb
caren-api-0.11.1 lib/caren/store/address.rb
caren-api-0.11.0 lib/caren/store/address.rb
caren-api-0.10.0 lib/caren/store/address.rb
caren-api-0.9.10 lib/caren/store/address.rb
caren-api-0.9.9 lib/caren/store/address.rb
caren-api-0.9.8 lib/caren/store/address.rb
caren-api-0.9.7 lib/caren/store/address.rb
caren-api-0.9.6 lib/caren/store/address.rb
caren-api-0.9.4 lib/caren/store/address.rb
caren-api-0.9.3 lib/caren/store/address.rb
caren-api-0.9.2 lib/caren/store/address.rb
caren-api-0.9.1 lib/caren/store/address.rb
caren-api-0.9.0 lib/caren/store/address.rb
caren-api-0.8.0 lib/caren/store/address.rb