Class: Puppet::Pops::Serialization::Extension::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/pops/serialization/extension.rb

Overview

The class that triggers the use of the COMMENT extension. The payload is comment text

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(comment) ⇒ Comment

Returns a new instance of Comment.



113
114
115
# File 'lib/puppet/pops/serialization/extension.rb', line 113

def initialize(comment)
  @comment = comment
end

Instance Attribute Details

#commentObject (readonly)



112
113
114
# File 'lib/puppet/pops/serialization/extension.rb', line 112

def comment
  @comment
end

Instance Method Details

#eql?(o) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


121
122
123
# File 'lib/puppet/pops/serialization/extension.rb', line 121

def eql?(o)
  o.is_a?(Comment) && o.comment == @comment
end

#hashObject



117
118
119
# File 'lib/puppet/pops/serialization/extension.rb', line 117

def hash
  @comment.hash
end