Sha256: feef8a869457ecabe0ca0ca92ad16affbfc8b5123a131572bc9a065c56961d7a
Contents?: true
Size: 803 Bytes
Versions: 7
Compression:
Stored size: 803 Bytes
Contents
# frozen_string_literal: true require_relative '../reference' # Reference attribute type for has_one module LedgerSync class ResourceAttribute class Reference class One < Reference module Mixin def self.included(base) base.extend(ClassMethods) end module ClassMethods def references_one(name, to:) resource_attribute = ResourceAttribute::Reference::One.new(name: name, to: to) resource_attributes.add resource_attribute _define_attribute_methods(name) end end end def initialize(name:, to:) super( name: name, type: Type::ReferenceOne.new(resource_class: to) ) end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems