Class: LedgerSync::ResourceAttribute::Reference::One

Inherits:
LedgerSync::ResourceAttribute::Reference show all
Defined in:
lib/ledger_sync/resource_attribute/reference/one.rb

Defined Under Namespace

Modules: Mixin

Instance Attribute Summary

Attributes inherited from LedgerSync::ResourceAttribute

#name, #reference, #resource_class, #type, #value

Instance Method Summary collapse

Methods inherited from LedgerSync::ResourceAttribute

#assert_valid, #cast, #reference?, #references_many?, #valid_with?, #will_change?

Methods included from Util::Mixins::DupableMixin

#dup

Constructor Details

#initialize(args = {}) ⇒ One

Returns a new instance of One.



33
34
35
36
37
38
39
40
# File 'lib/ledger_sync/resource_attribute/reference/one.rb', line 33

def initialize(args = {})
  to = args.fetch(:to)
  super(
    args.except(:to).merge(
      type: Type::ReferenceOne.new(resource_class: to)
    )
  )
end