Class: PayPal::SDK::REST::DataTypes::ShippingInfo

Inherits:
Base show all
Defined in:
lib/paypal-sdk/rest/data_types.rb

Constant Summary

Constants inherited from Core::API::DataTypes::Base

Core::API::DataTypes::Base::ContentKey, Core::API::DataTypes::Base::HashOptions

Instance Attribute Summary

Attributes inherited from Base

#error, #header, #request_id

Class Method Summary collapse

Methods inherited from Base

#http_header, #merge!, #raise_error!, raise_on_api_error, #success?

Methods inherited from Core::API::DataTypes::Base

add_attribute, add_member, array_of, #convert_array, #convert_object, define_alias_methods, #hash_key, #initialize, #member_names, members, #members, #merge!, object_of, #set, #skip_value?, snakecase, #to_hash, #value_to_hash

Methods included from Core::Logging

#log_event, #logger, logger, logger=

Constructor Details

This class inherits a constructor from PayPal::SDK::Core::API::DataTypes::Base

Class Method Details

.load_membersObject



1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
# File 'lib/paypal-sdk/rest/data_types.rb', line 1861

def self.load_members
  object_of :first_name, String
  object_of :last_name, String
  object_of :business_name, String
  object_of :address, InvoiceAddress
  object_of :email, String

  define_method "address=" do |value|
    if value.is_a?(Address)
      value = value.to_hash
    end
    object = convert_object(value, InvoiceAddress)
    instance_variable_set("@address", object)
  end

  define_method "address" do |&block|
    default_value = PayPal::SDK::Core::Util::OrderedHash.new
    value = instance_variable_get("@address") || ( default_value && (send("address=", default_value)))
    value = convert_object(value.to_hash, Address)
    value
  end

  define_method "invoice_address=" do |value|
    object = convert_object(value, InvoiceAddress)
    instance_variable_set("@address", object)
  end

  define_method "invoice_address" do |&block|
    default_value = PayPal::SDK::Core::Util::OrderedHash.new
    value = instance_variable_get("@address") || ( default_value && (send("address=", default_value)))
    value
  end
end