Class: Upkeep::Dependencies::Restored

Inherits:
Base
  • Object
show all
Defined in:
lib/upkeep/dependencies.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#key, #metadata, #source

Instance Method Summary collapse

Methods inherited from Base

#cache_key, #matches_change?, #narrow_frame_safe?, #to_h

Constructor Details

#initialize(source:, key:, metadata:, visibility:, precision:) ⇒ Restored

Returns a new instance of Restored.



359
360
361
362
363
# File 'lib/upkeep/dependencies.rb', line 359

def initialize(source:, key:, metadata:, visibility:, precision:)
  super(source: source, key: key, metadata: )
  @visibility = visibility.to_sym
  @precision = precision.to_sym
end

Instance Attribute Details

#precisionObject (readonly)

Returns the value of attribute precision.



375
376
377
# File 'lib/upkeep/dependencies.rb', line 375

def precision
  @precision
end

#visibilityObject (readonly)

Returns the value of attribute visibility.



375
376
377
# File 'lib/upkeep/dependencies.rb', line 375

def visibility
  @visibility
end

Instance Method Details

#identity?Boolean

Returns:

  • (Boolean)


365
366
367
# File 'lib/upkeep/dependencies.rb', line 365

def identity?
  visibility == :identity_bound
end

#identity_keyObject



369
370
371
372
373
# File 'lib/upkeep/dependencies.rb', line 369

def identity_key
  return unless identity?

  { source: source, key: key.fetch(:key), value: key.fetch(:value) }
end