Class: Pathway::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/pathway.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, message: nil, details: nil) ⇒ Error

Returns a new instance of Error.



42
43
44
45
46
# File 'lib/pathway.rb', line 42

def initialize(type:, message: nil, details: nil)
  @type    = type.to_sym
  @message = message || default_message_for(type)
  @details = details || {}
end

Instance Attribute Details

#detailsObject (readonly)

Returns the value of attribute details.



37
38
39
# File 'lib/pathway.rb', line 37

def details
  @details
end

#messageObject (readonly)

Returns the value of attribute message.



37
38
39
# File 'lib/pathway.rb', line 37

def message
  @message
end

#typeObject (readonly)

Returns the value of attribute type.



37
38
39
# File 'lib/pathway.rb', line 37

def type
  @type
end

Instance Method Details

#deconstructObject



48
49
50
# File 'lib/pathway.rb', line 48

def deconstruct
  [type, message, details]
end

#deconstruct_keys(_) ⇒ Object



52
53
54
# File 'lib/pathway.rb', line 52

def deconstruct_keys(_)
  { type: type, message: message, details: details }
end