Class: Opbeat::ErrorMessage::Exception

Inherits:
Struct
  • Object
show all
Defined in:
lib/opbeat/error_message/exception.rb

Constant Summary collapse

SPLIT =
'::'.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Struct

#to_h

Instance Attribute Details

#moduleObject

Returns the value of attribute module

Returns:

  • (Object)

    the current value of module



3
4
5
# File 'lib/opbeat/error_message/exception.rb', line 3

def module
  @module
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



3
4
5
# File 'lib/opbeat/error_message/exception.rb', line 3

def type
  @type
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



3
4
5
# File 'lib/opbeat/error_message/exception.rb', line 3

def value
  @value
end

Class Method Details

.from(exception) ⇒ Object



6
7
8
9
# File 'lib/opbeat/error_message/exception.rb', line 6

def self.from exception
  new exception.class.to_s, exception.message,
    exception.class.to_s.split(SPLIT)[0...-1].join(SPLIT)
end