Class: LedgerSync::QuickBooksOnline::Serialization::Type::MappingType
- Inherits:
-
Type::Value
- Object
- ActiveModel::Type::Value
- Type::Value
- LedgerSync::QuickBooksOnline::Serialization::Type::MappingType
- Defined in:
- lib/ledger_sync/ledgers/quickbooks_online/serialziation/type/mapping_type.rb
Instance Attribute Summary collapse
-
#mapping ⇒ Object
readonly
Returns the value of attribute mapping.
Instance Method Summary collapse
- #cast_value(args = {}) ⇒ Object
-
#initialize(args = {}) ⇒ MappingType
constructor
A new instance of MappingType.
Methods included from Type::ValueMixin
#assert_valid, #cast, included, #valid?
Constructor Details
#initialize(args = {}) ⇒ MappingType
Returns a new instance of MappingType.
10 11 12 |
# File 'lib/ledger_sync/ledgers/quickbooks_online/serialziation/type/mapping_type.rb', line 10 def initialize(args = {}) @mapping = args.fetch(:mapping) end |
Instance Attribute Details
#mapping ⇒ Object (readonly)
Returns the value of attribute mapping.
8 9 10 |
# File 'lib/ledger_sync/ledgers/quickbooks_online/serialziation/type/mapping_type.rb', line 8 def mapping @mapping end |
Instance Method Details
#cast_value(args = {}) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/ledger_sync/ledgers/quickbooks_online/serialziation/type/mapping_type.rb', line 14 def cast_value(args = {}) value = args.fetch(:value) return if value.nil? mapping.fetch(:value) end |