Class: PaczkomatyInpost::InpostPack
- Inherits:
-
Object
- Object
- PaczkomatyInpost::InpostPack
- Extended by:
- ActiveModel::Naming
- Includes:
- ActiveModel::Conversion, ActiveModel::Validations
- Defined in:
- lib/paczkomaty_inpost/inpost_pack.rb
Instance Attribute Summary collapse
-
#adresee_email ⇒ Object
Returns the value of attribute adresee_email.
-
#alternative_box_machine_name ⇒ Object
Returns the value of attribute alternative_box_machine_name.
-
#box_machine_name ⇒ Object
Returns the value of attribute box_machine_name.
-
#customer_delivering ⇒ Object
Returns the value of attribute customer_delivering.
-
#customer_ref ⇒ Object
Returns the value of attribute customer_ref.
-
#insurance_amount ⇒ Object
Returns the value of attribute insurance_amount.
-
#on_delivery_amount ⇒ Object
Returns the value of attribute on_delivery_amount.
-
#pack_type ⇒ Object
Returns the value of attribute pack_type.
-
#phone_num ⇒ Object
Returns the value of attribute phone_num.
-
#sender_address ⇒ Object
Returns the value of attribute sender_address.
-
#sender_box_machine_name ⇒ Object
Returns the value of attribute sender_box_machine_name.
-
#sender_email ⇒ Object
Returns the value of attribute sender_email.
-
#temp_id ⇒ Object
Returns the value of attribute temp_id.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ InpostPack
constructor
A new instance of InpostPack.
- #persisted? ⇒ Boolean
- #sender_address_type ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ InpostPack
Returns a new instance of InpostPack.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/paczkomaty_inpost/inpost_pack.rb', line 20 def initialize(attributes = {}) attributes.each do |name, value| send("#{name}=", value) end missing_attributes = [:alternative_box_machine_name, :customer_delivering, :sender_box_machine_name, :customer_ref, :sender_address] - attributes.keys missing_attributes.each do |name| send("#{name}=", nil) end end |
Instance Attribute Details
#adresee_email ⇒ Object
Returns the value of attribute adresee_email.
11 12 13 |
# File 'lib/paczkomaty_inpost/inpost_pack.rb', line 11 def adresee_email @adresee_email end |
#alternative_box_machine_name ⇒ Object
Returns the value of attribute alternative_box_machine_name.
11 12 13 |
# File 'lib/paczkomaty_inpost/inpost_pack.rb', line 11 def alternative_box_machine_name @alternative_box_machine_name end |
#box_machine_name ⇒ Object
Returns the value of attribute box_machine_name.
11 12 13 |
# File 'lib/paczkomaty_inpost/inpost_pack.rb', line 11 def box_machine_name @box_machine_name end |
#customer_delivering ⇒ Object
Returns the value of attribute customer_delivering.
11 12 13 |
# File 'lib/paczkomaty_inpost/inpost_pack.rb', line 11 def customer_delivering @customer_delivering end |
#customer_ref ⇒ Object
Returns the value of attribute customer_ref.
11 12 13 |
# File 'lib/paczkomaty_inpost/inpost_pack.rb', line 11 def customer_ref @customer_ref end |
#insurance_amount ⇒ Object
Returns the value of attribute insurance_amount.
11 12 13 |
# File 'lib/paczkomaty_inpost/inpost_pack.rb', line 11 def insurance_amount @insurance_amount end |
#on_delivery_amount ⇒ Object
Returns the value of attribute on_delivery_amount.
11 12 13 |
# File 'lib/paczkomaty_inpost/inpost_pack.rb', line 11 def on_delivery_amount @on_delivery_amount end |
#pack_type ⇒ Object
Returns the value of attribute pack_type.
11 12 13 |
# File 'lib/paczkomaty_inpost/inpost_pack.rb', line 11 def pack_type @pack_type end |
#phone_num ⇒ Object
Returns the value of attribute phone_num.
11 12 13 |
# File 'lib/paczkomaty_inpost/inpost_pack.rb', line 11 def phone_num @phone_num end |
#sender_address ⇒ Object
Returns the value of attribute sender_address.
11 12 13 |
# File 'lib/paczkomaty_inpost/inpost_pack.rb', line 11 def sender_address @sender_address end |
#sender_box_machine_name ⇒ Object
Returns the value of attribute sender_box_machine_name.
11 12 13 |
# File 'lib/paczkomaty_inpost/inpost_pack.rb', line 11 def sender_box_machine_name @sender_box_machine_name end |
#sender_email ⇒ Object
Returns the value of attribute sender_email.
11 12 13 |
# File 'lib/paczkomaty_inpost/inpost_pack.rb', line 11 def sender_email @sender_email end |
#temp_id ⇒ Object
Returns the value of attribute temp_id.
11 12 13 |
# File 'lib/paczkomaty_inpost/inpost_pack.rb', line 11 def temp_id @temp_id end |
Instance Method Details
#persisted? ⇒ Boolean
38 39 40 |
# File 'lib/paczkomaty_inpost/inpost_pack.rb', line 38 def persisted? false end |
#sender_address_type ⇒ Object
32 33 34 35 36 |
# File 'lib/paczkomaty_inpost/inpost_pack.rb', line 32 def sender_address_type unless sender_address.kind_of?(Hash) errors.add(:base, "Must be hash with sender address information") end end |