1 |
# frozen_string_literal: true
|
|
2 |
|
|
|
require_relative 'value'
|
4✔ |
4 |
|
|
|
module LedgerSync |
4✔ |
|
module Type |
4✔ |
|
class ReferenceOne < Value # :nodoc: |
4✔ |
|
include ValueMixin
|
4✔ |
9 |
|
|
|
attr_reader :resource_class
|
4✔ |
11 |
|
|
|
def initialize(resource_class:) |
4✔ |
|
@resource_class = resource_class
|
60✔ |
|
super()
|
60✔ |
15 |
end
|
|
16 |
|
|
|
def type |
4✔ |
|
:reference_one
|
× |
19 |
end
|
|
20 |
|
|
|
def resource_classes |
4✔ |
|
@resource_classes ||= if resource_class.is_a?(Array) |
592✔ |
|
resource_class |
× |
24 |
else
|
|
|
[resource_class] |
144✔ |
26 |
end
|
|
27 |
end
|
|
28 |
|
|
|
private |
4✔ |
30 |
|
|
|
def valid_classes |
4✔ |
|
resource_classes |
480✔ |
33 |
end
|
|
34 |
end
|
|
35 |
end
|
|
36 |
end
|