Class: Vernacular::ConfigurationHash
- Inherits:
-
Object
- Object
- Vernacular::ConfigurationHash
- Defined in:
- lib/vernacular/configuration_hash.rb
Overview
Builds a hash out of the given modifiers that represents that current state of configuration. This ensures that if the configuration of ‘Vernacular` changes between runs it doesn’t pick up the old compiled files.
Instance Attribute Summary collapse
-
#modifiers ⇒ Object
readonly
Returns the value of attribute modifiers.
Instance Method Summary collapse
- #hash ⇒ Object
-
#initialize(modifiers = []) ⇒ ConfigurationHash
constructor
A new instance of ConfigurationHash.
Constructor Details
#initialize(modifiers = []) ⇒ ConfigurationHash
Returns a new instance of ConfigurationHash.
10 11 12 |
# File 'lib/vernacular/configuration_hash.rb', line 10 def initialize(modifiers = []) @modifiers = modifiers end |
Instance Attribute Details
#modifiers ⇒ Object (readonly)
Returns the value of attribute modifiers.
8 9 10 |
# File 'lib/vernacular/configuration_hash.rb', line 8 def modifiers @modifiers end |
Instance Method Details
#hash ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/vernacular/configuration_hash.rb', line 14 def hash digest = Digest::MD5.new modifiers.each do |modifier| digest << modifier.components.inspect end digest.to_s end |