Class: Conekta::ShippingContact
- Inherits:
-
Resource
- Object
- Hash
- ConektaObject
- Resource
- Conekta::ShippingContact
- Defined in:
- lib/conekta/shipping_contact.rb
Instance Attribute Summary collapse
-
#between_streets ⇒ Object
Returns the value of attribute between_streets.
-
#default ⇒ Object
Returns the value of attribute default.
-
#parent_id ⇒ Object
Returns the value of attribute parent_id.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#receiver ⇒ Object
Returns the value of attribute receiver.
Attributes inherited from Resource
Attributes inherited from ConektaObject
Instance Method Summary collapse
Methods included from Operations::CustomAction
Methods included from Operations::Update
Methods included from Operations::Delete
Methods inherited from Resource
_url, #create_member_with_relation, #initialize, underscored_class
Methods inherited from ConektaObject
#class_name, class_name, #create_attr, #first, #initialize, #inspect, #last, #load_from, #set_val, #to_s, #unset_key
Constructor Details
This class inherits a constructor from Conekta::Resource
Instance Attribute Details
#between_streets ⇒ Object
Returns the value of attribute between_streets.
7 8 9 |
# File 'lib/conekta/shipping_contact.rb', line 7 def between_streets @between_streets end |
#default ⇒ Object
Returns the value of attribute default.
7 8 9 |
# File 'lib/conekta/shipping_contact.rb', line 7 def default @default end |
#parent_id ⇒ Object
Returns the value of attribute parent_id.
7 8 9 |
# File 'lib/conekta/shipping_contact.rb', line 7 def parent_id @parent_id end |
#phone ⇒ Object
Returns the value of attribute phone.
7 8 9 |
# File 'lib/conekta/shipping_contact.rb', line 7 def phone @phone end |
#receiver ⇒ Object
Returns the value of attribute receiver.
7 8 9 |
# File 'lib/conekta/shipping_contact.rb', line 7 def receiver @receiver end |
Instance Method Details
#_url ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/conekta/shipping_contact.rb', line 9 def _url if (id.nil? || id.to_s.empty?) exception = Error.new({ "message" => I18n.t('error.resource.id', { resource: self.class.class_name, locale: :en }), "message_to_purchaser" => I18n.t('error.resource.id_purchaser', { locale: Conekta.locale.to_sym }) }) if Conekta.api_version == "2.0.0" error_list = Conekta::ErrorList.new error_list.details << exception exception = error_list end raise exception end self.customer._url + self.class._url + "/" + id end |
#delete ⇒ Object
28 29 30 |
# File 'lib/conekta/shipping_contact.rb', line 28 def delete self.delete_member('customer', 'shipping_contacts') end |