Class: Milkshake::Linker
- Inherits:
-
Object
- Object
- Milkshake::Linker
- Defined in:
- lib/milkshake/linker.rb
Instance Attribute Summary collapse
-
#cache ⇒ Object
readonly
Returns the value of attribute cache.
-
#current_snapshot ⇒ Object
readonly
Returns the value of attribute current_snapshot.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#validator ⇒ Object
readonly
Returns the value of attribute validator.
Instance Method Summary collapse
-
#initialize(environment, validator, cache) ⇒ Linker
constructor
A new instance of Linker.
- #link! ⇒ Object
Constructor Details
#initialize(environment, validator, cache) ⇒ Linker
Returns a new instance of Linker.
9 10 11 12 13 |
# File 'lib/milkshake/linker.rb', line 9 def initialize(environment, validator, cache) @environment = environment @validator = validator @cache = cache end |
Instance Attribute Details
#cache ⇒ Object (readonly)
Returns the value of attribute cache.
7 8 9 |
# File 'lib/milkshake/linker.rb', line 7 def cache @cache end |
#current_snapshot ⇒ Object (readonly)
Returns the value of attribute current_snapshot.
7 8 9 |
# File 'lib/milkshake/linker.rb', line 7 def current_snapshot @current_snapshot end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
7 8 9 |
# File 'lib/milkshake/linker.rb', line 7 def environment @environment end |
#validator ⇒ Object (readonly)
Returns the value of attribute validator.
7 8 9 |
# File 'lib/milkshake/linker.rb', line 7 def validator @validator end |
Instance Method Details
#link! ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/milkshake/linker.rb', line 15 def link! link_only_once do if validator.relink? @current_snapshot = Snapshots.dump run_migrations! validator.persist! cache.persist! end end end |