Class: ReactorSDK::Resources::UpstreamChainEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/reactor_sdk/resources/upstream_chain_entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(library:, stage:, resource:, revision_id:, revision:) ⇒ UpstreamChainEntry

Returns a new instance of UpstreamChainEntry.



21
22
23
24
25
26
27
# File 'lib/reactor_sdk/resources/upstream_chain_entry.rb', line 21

def initialize(library:, stage:, resource:, revision_id:, revision:)
  @library = library
  @stage = stage
  @resource = resource
  @revision_id = revision_id
  @revision = revision
end

Instance Attribute Details

#libraryObject (readonly)

Returns the value of attribute library.



19
20
21
# File 'lib/reactor_sdk/resources/upstream_chain_entry.rb', line 19

def library
  @library
end

#resourceObject (readonly)

Returns the value of attribute resource.



19
20
21
# File 'lib/reactor_sdk/resources/upstream_chain_entry.rb', line 19

def resource
  @resource
end

#revisionObject (readonly)

Returns the value of attribute revision.



19
20
21
# File 'lib/reactor_sdk/resources/upstream_chain_entry.rb', line 19

def revision
  @revision
end

#revision_idObject (readonly)

Returns the value of attribute revision_id.



19
20
21
# File 'lib/reactor_sdk/resources/upstream_chain_entry.rb', line 19

def revision_id
  @revision_id
end

#stageObject (readonly)

Returns the value of attribute stage.



19
20
21
# File 'lib/reactor_sdk/resources/upstream_chain_entry.rb', line 19

def stage
  @stage
end

Instance Method Details

#entity_snapshotHash?

Returns Point-in-time snapshot for the matched revision.

Returns:

  • (Hash, nil)

    Point-in-time snapshot for the matched revision



39
40
41
# File 'lib/reactor_sdk/resources/upstream_chain_entry.rb', line 39

def entity_snapshot
  @revision&.entity_snapshot
end

#inspectString

Returns Human-readable representation.

Returns:

  • (String)

    Human-readable representation



46
47
48
49
50
51
52
# File 'lib/reactor_sdk/resources/upstream_chain_entry.rb', line 46

def inspect
  '#<ReactorSDK::Resources::UpstreamChainEntry ' \
    "library_id=#{library.id.inspect} " \
    "stage=#{stage.inspect} " \
    "resource_id=#{resource&.id.inspect} " \
    "revision_id=#{revision_id.inspect}>"
end

#present?Boolean

Returns true when the resource exists in this upstream library.

Returns:

  • (Boolean)

    true when the resource exists in this upstream library



32
33
34
# File 'lib/reactor_sdk/resources/upstream_chain_entry.rb', line 32

def present?
  !@resource.nil?
end