Class: Familia::Migration::Script::ScriptEntry

Inherits:
Data
  • Object
show all
Defined in:
lib/familia/migration/script.rb

Overview

Holds script source and precomputed SHA1

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source:, sha: nil) ⇒ ScriptEntry

Returns a new instance of ScriptEntry.



36
37
38
39
# File 'lib/familia/migration/script.rb', line 36

def initialize(source:, sha: nil)
  computed_sha = sha || Digest::SHA1.hexdigest(source)
  super(source: source.freeze, sha: computed_sha.freeze)
end

Instance Attribute Details

#shaObject (readonly)

Returns the value of attribute sha

Returns:

  • (Object)

    the current value of sha



35
36
37
# File 'lib/familia/migration/script.rb', line 35

def sha
  @sha
end

#sourceObject (readonly)

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



35
36
37
# File 'lib/familia/migration/script.rb', line 35

def source
  @source
end