Class: ReactorSDK::Resources::ComprehensiveUpstreamChain

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/reactor_sdk/resources/comprehensive_upstream_chain.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource_id:, resource_type:, property_id:, target_library_id:, target_resource:, target_revision_id:, target_comprehensive_resource:, entries:) ⇒ ComprehensiveUpstreamChain

Returns a new instance of ComprehensiveUpstreamChain.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/reactor_sdk/resources/comprehensive_upstream_chain.rb', line 17

def initialize(
  resource_id:,
  resource_type:,
  property_id:,
  target_library_id:,
  target_resource:,
  target_revision_id:,
  target_comprehensive_resource:,
  entries:
)
  @resource_id = resource_id
  @resource_type = resource_type
  @property_id = property_id
  @target_library_id = target_library_id
  @target_resource = target_resource
  @target_revision_id = target_revision_id
  @target_comprehensive_resource = target_comprehensive_resource
  @entries = Array(entries)
end

Instance Attribute Details

#entriesObject (readonly)

Returns the value of attribute entries.



8
9
10
# File 'lib/reactor_sdk/resources/comprehensive_upstream_chain.rb', line 8

def entries
  @entries
end

#property_idObject (readonly)

Returns the value of attribute property_id.



8
9
10
# File 'lib/reactor_sdk/resources/comprehensive_upstream_chain.rb', line 8

def property_id
  @property_id
end

#resource_idObject (readonly)

Returns the value of attribute resource_id.



8
9
10
# File 'lib/reactor_sdk/resources/comprehensive_upstream_chain.rb', line 8

def resource_id
  @resource_id
end

#resource_typeObject (readonly)

Returns the value of attribute resource_type.



8
9
10
# File 'lib/reactor_sdk/resources/comprehensive_upstream_chain.rb', line 8

def resource_type
  @resource_type
end

#target_comprehensive_resourceObject (readonly)

Returns the value of attribute target_comprehensive_resource.



8
9
10
# File 'lib/reactor_sdk/resources/comprehensive_upstream_chain.rb', line 8

def target_comprehensive_resource
  @target_comprehensive_resource
end

#target_library_idObject (readonly)

Returns the value of attribute target_library_id.



8
9
10
# File 'lib/reactor_sdk/resources/comprehensive_upstream_chain.rb', line 8

def target_library_id
  @target_library_id
end

#target_resourceObject (readonly)

Returns the value of attribute target_resource.



8
9
10
# File 'lib/reactor_sdk/resources/comprehensive_upstream_chain.rb', line 8

def target_resource
  @target_resource
end

#target_revision_idObject (readonly)

Returns the value of attribute target_revision_id.



8
9
10
# File 'lib/reactor_sdk/resources/comprehensive_upstream_chain.rb', line 8

def target_revision_id
  @target_revision_id
end

Instance Method Details

#eachObject



37
38
39
# File 'lib/reactor_sdk/resources/comprehensive_upstream_chain.rb', line 37

def each(&)
  @entries.each(&)
end

#found?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/reactor_sdk/resources/comprehensive_upstream_chain.rb', line 45

def found?
  !nearest_match.nil?
end

#nearest_matchObject



41
42
43
# File 'lib/reactor_sdk/resources/comprehensive_upstream_chain.rb', line 41

def nearest_match
  @entries.find(&:present?)
end