Class: LedgerSync::Type::ReferenceOne
- Includes:
- ValueMixin
- Defined in:
- lib/ledger_sync/type/reference_one.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#resource_class ⇒ Object
readonly
Returns the value of attribute resource_class.
Instance Method Summary collapse
-
#initialize(resource_class:) ⇒ ReferenceOne
constructor
A new instance of ReferenceOne.
- #resource_classes ⇒ Object
- #type ⇒ Object
Methods included from ValueMixin
#assert_valid, #cast, included, #valid?
Constructor Details
#initialize(resource_class:) ⇒ ReferenceOne
Returns a new instance of ReferenceOne.
12 13 14 15 |
# File 'lib/ledger_sync/type/reference_one.rb', line 12 def initialize(resource_class:) @resource_class = resource_class super() end |
Instance Attribute Details
#resource_class ⇒ Object (readonly)
Returns the value of attribute resource_class.
10 11 12 |
# File 'lib/ledger_sync/type/reference_one.rb', line 10 def resource_class @resource_class end |
Instance Method Details
#resource_classes ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/ledger_sync/type/reference_one.rb', line 21 def resource_classes @resource_classes ||= if resource_class.is_a?(Array) resource_class else [resource_class] end end |
#type ⇒ Object
17 18 19 |
# File 'lib/ledger_sync/type/reference_one.rb', line 17 def type :reference_one end |