Class: Xsys::Model::Transaction
- Inherits:
-
Object
- Object
- Xsys::Model::Transaction
- Defined in:
- lib/xsys/model/transaction.rb
Instance Attribute Summary collapse
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#items ⇒ Object
Returns the value of attribute items.
-
#logical_section_id ⇒ Object
Returns the value of attribute logical_section_id.
-
#physical_section_id ⇒ Object
Returns the value of attribute physical_section_id.
-
#product_id ⇒ Object
Returns the value of attribute product_id.
-
#product_provider_id ⇒ Object
Returns the value of attribute product_provider_id.
-
#receipt_number ⇒ Object
Returns the value of attribute receipt_number.
-
#seller_id ⇒ Object
Returns the value of attribute seller_id.
-
#shop_code ⇒ Object
Returns the value of attribute shop_code.
-
#shop_id ⇒ Object
Returns the value of attribute shop_id.
-
#transaction_date ⇒ Object
Returns the value of attribute transaction_date.
-
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
-
#transaction_kind_id ⇒ Object
Returns the value of attribute transaction_kind_id.
-
#transaction_status_id ⇒ Object
Returns the value of attribute transaction_status_id.
-
#user ⇒ Object
Returns the value of attribute user.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
-
#workshop_id ⇒ Object
Returns the value of attribute workshop_id.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Transaction
constructor
A new instance of Transaction.
Constructor Details
#initialize(attributes = {}) ⇒ Transaction
Returns a new instance of Transaction.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/xsys/model/transaction.rb', line 10 def initialize(attributes={}) attributes.each do |k,v| if k.to_s == 'transaction_date' self.transaction_date = Date.parse(v) unless v.nil? elsif k.to_s == 'user' self.user = User.new(v) unless v.nil? elsif k.to_s == 'items' self.items = v.map { |x| TransactionItem.new(x) } else self.send("#{k}=", v) if self.respond_to?(k) end end end |
Instance Attribute Details
#client_id ⇒ Object
Returns the value of attribute client_id.
4 5 6 |
# File 'lib/xsys/model/transaction.rb', line 4 def client_id @client_id end |
#items ⇒ Object
Returns the value of attribute items.
4 5 6 |
# File 'lib/xsys/model/transaction.rb', line 4 def items @items end |
#logical_section_id ⇒ Object
Returns the value of attribute logical_section_id.
4 5 6 |
# File 'lib/xsys/model/transaction.rb', line 4 def logical_section_id @logical_section_id end |
#physical_section_id ⇒ Object
Returns the value of attribute physical_section_id.
4 5 6 |
# File 'lib/xsys/model/transaction.rb', line 4 def physical_section_id @physical_section_id end |
#product_id ⇒ Object
Returns the value of attribute product_id.
4 5 6 |
# File 'lib/xsys/model/transaction.rb', line 4 def product_id @product_id end |
#product_provider_id ⇒ Object
Returns the value of attribute product_provider_id.
4 5 6 |
# File 'lib/xsys/model/transaction.rb', line 4 def product_provider_id @product_provider_id end |
#receipt_number ⇒ Object
Returns the value of attribute receipt_number.
4 5 6 |
# File 'lib/xsys/model/transaction.rb', line 4 def receipt_number @receipt_number end |
#seller_id ⇒ Object
Returns the value of attribute seller_id.
4 5 6 |
# File 'lib/xsys/model/transaction.rb', line 4 def seller_id @seller_id end |
#shop_code ⇒ Object
Returns the value of attribute shop_code.
4 5 6 |
# File 'lib/xsys/model/transaction.rb', line 4 def shop_code @shop_code end |
#shop_id ⇒ Object
Returns the value of attribute shop_id.
4 5 6 |
# File 'lib/xsys/model/transaction.rb', line 4 def shop_id @shop_id end |
#transaction_date ⇒ Object
Returns the value of attribute transaction_date.
4 5 6 |
# File 'lib/xsys/model/transaction.rb', line 4 def transaction_date @transaction_date end |
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
4 5 6 |
# File 'lib/xsys/model/transaction.rb', line 4 def transaction_id @transaction_id end |
#transaction_kind_id ⇒ Object
Returns the value of attribute transaction_kind_id.
4 5 6 |
# File 'lib/xsys/model/transaction.rb', line 4 def transaction_kind_id @transaction_kind_id end |
#transaction_status_id ⇒ Object
Returns the value of attribute transaction_status_id.
4 5 6 |
# File 'lib/xsys/model/transaction.rb', line 4 def transaction_status_id @transaction_status_id end |
#user ⇒ Object
Returns the value of attribute user.
4 5 6 |
# File 'lib/xsys/model/transaction.rb', line 4 def user @user end |
#user_id ⇒ Object
Returns the value of attribute user_id.
4 5 6 |
# File 'lib/xsys/model/transaction.rb', line 4 def user_id @user_id end |
#workshop_id ⇒ Object
Returns the value of attribute workshop_id.
4 5 6 |
# File 'lib/xsys/model/transaction.rb', line 4 def workshop_id @workshop_id end |