Class: ConfigOMat::GeneratedTemplate

Inherits:
ConfigItem show all
Defined in:
lib/config_o_mat/shared/types.rb

Instance Attribute Summary collapse

Attributes inherited from ConfigItem

#errors

Instance Method Summary collapse

Methods inherited from ConfigItem

#==, #error, #errors?, #validate!

Constructor Details

#initialize(contents) ⇒ GeneratedTemplate

Returns a new instance of GeneratedTemplate.



524
525
526
# File 'lib/config_o_mat/shared/types.rb', line 524

def initialize(contents)
  @digest = Digest::SHA256.hexdigest(contents)
end

Instance Attribute Details

#digestObject (readonly)

Returns the value of attribute digest.



522
523
524
# File 'lib/config_o_mat/shared/types.rb', line 522

def digest
  @digest
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


535
536
537
538
539
# File 'lib/config_o_mat/shared/types.rb', line 535

def eql?(other)
  return false if !super(other)
  return false if other.digest != digest
  true
end

#hashObject



531
532
533
# File 'lib/config_o_mat/shared/types.rb', line 531

def hash
  @digest.hash
end

#validateObject



528
529
# File 'lib/config_o_mat/shared/types.rb', line 528

def validate
end