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.5.20 lib/caren/store/address.rb
caren-api-0.5.19 lib/caren/store/address.rb
caren-api-0.5.18 lib/caren/store/address.rb
caren-api-0.5.17 lib/caren/store/address.rb
caren-api-0.5.16 lib/caren/store/address.rb
caren-api-0.5.15 lib/caren/store/address.rb
caren-api-0.5.14 lib/caren/store/address.rb
caren-api-0.5.13 lib/caren/store/address.rb
caren-api-0.5.12 lib/caren/store/address.rb
caren-api-0.5.10 lib/caren/store/address.rb
caren-api-0.5.9 lib/caren/store/address.rb
caren-api-0.5.8 lib/caren/store/address.rb
caren-api-0.5.7 lib/caren/store/address.rb
caren-api-0.5.6 lib/caren/store/address.rb
caren-api-0.5.5 lib/caren/store/address.rb
caren-api-0.5.4 lib/caren/store/address.rb
caren-api-0.5.3 lib/caren/store/address.rb
caren-api-0.5.2 lib/caren/store/address.rb
caren-api-0.5.1 lib/caren/store/address.rb
caren-api-0.5.0 lib/caren/store/address.rb