Class: Familia::Migration::Script::ScriptEntry
- Inherits:
-
Data
- Object
- Data
- Familia::Migration::Script::ScriptEntry
- Defined in:
- lib/familia/migration/script.rb
Overview
Holds script source and precomputed SHA1
Instance Attribute Summary collapse
-
#sha ⇒ Object
readonly
Returns the value of attribute sha.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(source:, sha: nil) ⇒ ScriptEntry
constructor
A new instance of ScriptEntry.
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
#sha ⇒ Object (readonly)
Returns the value of attribute sha
35 36 37 |
# File 'lib/familia/migration/script.rb', line 35 def sha @sha end |
#source ⇒ Object (readonly)
Returns the value of attribute source
35 36 37 |
# File 'lib/familia/migration/script.rb', line 35 def source @source end |