Exception: Peck::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/peck/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, message) ⇒ Error

Returns a new instance of Error.



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

def initialize(type, message)
  @type = type.to_s
  super message
end

Instance Attribute Details

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/peck/error.rb', line 5

def type
  @type
end

Instance Method Details

#count_as?(type) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/peck/error.rb', line 12

def count_as?(type)
  @type == type.to_s
end