Exception: Speculation::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/speculation/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, data) ⇒ Error

Returns a new instance of Error


9
10
11
12
13
# File 'lib/speculation/error.rb', line 9

def initialize(message, data)
  super(message)
  @data = data
  @message = message
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data


7
8
9
# File 'lib/speculation/error.rb', line 7

def data
  @data
end

#messageObject (readonly)

Returns the value of attribute message


7
8
9
# File 'lib/speculation/error.rb', line 7

def message
  @message
end

Instance Method Details

#to_sObject


15
16
17
# File 'lib/speculation/error.rb', line 15

def to_s
  "#{@message} #{PP.pp(@data, String.new)}"
end