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.



495
496
497
# File 'lib/config_o_mat/shared/types.rb', line 495

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

Instance Attribute Details

#digestObject (readonly)

Returns the value of attribute digest.



493
494
495
# File 'lib/config_o_mat/shared/types.rb', line 493

def digest
  @digest
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


506
507
508
509
510
# File 'lib/config_o_mat/shared/types.rb', line 506

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

#hashObject



502
503
504
# File 'lib/config_o_mat/shared/types.rb', line 502

def hash
  @digest.hash
end

#validateObject



499
500
# File 'lib/config_o_mat/shared/types.rb', line 499

def validate
end