Class: Puppet::DataTypes::Error
- Defined in:
- lib/puppet/datatypes/impl/error.rb
Instance Attribute Summary collapse
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#issue_code ⇒ Object
readonly
Returns the value of attribute issue_code.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#msg ⇒ Object
(also: #message)
readonly
Returns the value of attribute msg.
Class Method Summary collapse
Instance Method Summary collapse
- #_pcore_init_hash ⇒ Object
- #eql?(o) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(msg, kind = nil, details = nil, issue_code = nil) ⇒ Error
constructor
A new instance of Error.
- #to_s ⇒ Object
Constructor Details
#initialize(msg, kind = nil, details = nil, issue_code = nil) ⇒ Error
Returns a new instance of Error.
19 20 21 22 23 24 |
# File 'lib/puppet/datatypes/impl/error.rb', line 19 def initialize(msg, kind = nil, details = nil, issue_code = nil) @msg = msg @kind = kind @details = details @issue_code = issue_code end |
Instance Attribute Details
#details ⇒ Object (readonly)
Returns the value of attribute details.
4 5 6 |
# File 'lib/puppet/datatypes/impl/error.rb', line 4 def details @details end |
#issue_code ⇒ Object (readonly)
Returns the value of attribute issue_code.
4 5 6 |
# File 'lib/puppet/datatypes/impl/error.rb', line 4 def issue_code @issue_code end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
4 5 6 |
# File 'lib/puppet/datatypes/impl/error.rb', line 4 def kind @kind end |
#msg ⇒ Object (readonly) Also known as: message
Returns the value of attribute msg.
4 5 6 |
# File 'lib/puppet/datatypes/impl/error.rb', line 4 def msg @msg end |
Class Method Details
.from_asserted_hash(hash) ⇒ Object
7 8 9 |
# File 'lib/puppet/datatypes/impl/error.rb', line 7 def self.from_asserted_hash(hash) new(hash['msg'], hash['kind'], hash['details'], hash['issue_code']) end |
Instance Method Details
#_pcore_init_hash ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/puppet/datatypes/impl/error.rb', line 11 def _pcore_init_hash result = { 'msg' => @msg } result['kind'] = @kind unless @kind.nil? result['details'] = @details unless @details.nil? result['issue_code'] = @issue_code unless @issue_code.nil? result end |
#eql?(o) ⇒ Boolean Also known as: ==
26 27 28 29 30 31 32 |
# File 'lib/puppet/datatypes/impl/error.rb', line 26 def eql?(o) self.class.equal?(o.class) && @msg == o.msg && @kind == o.kind && @issue_code == o.issue_code && @details == o.details end |
#hash ⇒ Object
35 36 37 |
# File 'lib/puppet/datatypes/impl/error.rb', line 35 def hash @msg.hash ^ @kind.hash ^ @issue_code.hash end |