Class: Belpost::Models::Batch
- Inherits:
-
Object
- Object
- Belpost::Models::Batch
- Defined in:
- lib/belpost/models/batch.rb
Overview
Model class for batch mailing
Instance Attribute Summary collapse
-
#card_number ⇒ Object
readonly
Returns the value of attribute card_number.
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#is_declared_value ⇒ Object
readonly
Returns the value of attribute is_declared_value.
-
#is_document ⇒ Object
readonly
Returns the value of attribute is_document.
-
#is_partial_receipt ⇒ Object
readonly
Returns the value of attribute is_partial_receipt.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#negotiated_rate ⇒ Object
readonly
Returns the value of attribute negotiated_rate.
-
#payment_type ⇒ Object
readonly
Returns the value of attribute payment_type.
-
#postal_delivery_type ⇒ Object
readonly
Returns the value of attribute postal_delivery_type.
-
#postal_items_in_ops ⇒ Object
readonly
Returns the value of attribute postal_items_in_ops.
Instance Method Summary collapse
-
#initialize(data) ⇒ Batch
constructor
A new instance of Batch.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ Batch
Returns a new instance of Batch.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/belpost/models/batch.rb', line 11 def initialize(data) @postal_delivery_type = data[:postal_delivery_type] @direction = data[:direction] @payment_type = data[:payment_type] @negotiated_rate = data[:negotiated_rate] @name = data[:name] @card_number = data[:card_number] @postal_items_in_ops = data[:postal_items_in_ops] @category = data[:category] @is_document = data[:is_document] @is_declared_value = data[:is_declared_value] @is_partial_receipt = data[:is_partial_receipt] end |
Instance Attribute Details
#card_number ⇒ Object (readonly)
Returns the value of attribute card_number.
7 8 9 |
# File 'lib/belpost/models/batch.rb', line 7 def card_number @card_number end |
#category ⇒ Object (readonly)
Returns the value of attribute category.
7 8 9 |
# File 'lib/belpost/models/batch.rb', line 7 def category @category end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
7 8 9 |
# File 'lib/belpost/models/batch.rb', line 7 def direction @direction end |
#is_declared_value ⇒ Object (readonly)
Returns the value of attribute is_declared_value.
7 8 9 |
# File 'lib/belpost/models/batch.rb', line 7 def is_declared_value @is_declared_value end |
#is_document ⇒ Object (readonly)
Returns the value of attribute is_document.
7 8 9 |
# File 'lib/belpost/models/batch.rb', line 7 def is_document @is_document end |
#is_partial_receipt ⇒ Object (readonly)
Returns the value of attribute is_partial_receipt.
7 8 9 |
# File 'lib/belpost/models/batch.rb', line 7 def is_partial_receipt @is_partial_receipt end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/belpost/models/batch.rb', line 7 def name @name end |
#negotiated_rate ⇒ Object (readonly)
Returns the value of attribute negotiated_rate.
7 8 9 |
# File 'lib/belpost/models/batch.rb', line 7 def negotiated_rate @negotiated_rate end |
#payment_type ⇒ Object (readonly)
Returns the value of attribute payment_type.
7 8 9 |
# File 'lib/belpost/models/batch.rb', line 7 def payment_type @payment_type end |
#postal_delivery_type ⇒ Object (readonly)
Returns the value of attribute postal_delivery_type.
7 8 9 |
# File 'lib/belpost/models/batch.rb', line 7 def postal_delivery_type @postal_delivery_type end |
#postal_items_in_ops ⇒ Object (readonly)
Returns the value of attribute postal_items_in_ops.
7 8 9 |
# File 'lib/belpost/models/batch.rb', line 7 def postal_items_in_ops @postal_items_in_ops end |
Instance Method Details
#to_h ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/belpost/models/batch.rb', line 25 def to_h { postal_delivery_type: @postal_delivery_type, direction: @direction, payment_type: @payment_type, negotiated_rate: @negotiated_rate, name: @name, card_number: @card_number, postal_items_in_ops: @postal_items_in_ops, category: @category, is_document: @is_document, is_declared_value: @is_declared_value, is_partial_receipt: @is_partial_receipt }.compact end |