Class: GreenPepper::ErrorType

Inherits:
TypeBase
  • Object
show all
Defined in:
lib/greenpepper/converter.rb

Class Method Summary collapse

Methods inherited from TypeBase

can_parse?, inherited

Class Method Details

.convertObject



99
100
101
# File 'lib/greenpepper/converter.rb', line 99

def self.convert
  Proc.new{|s| Exception.new}
end

.formatObject



103
104
105
106
107
108
109
110
111
# File 'lib/greenpepper/converter.rb', line 103

def self.format
  Proc.new{|object, expected_format|
    if object.is_a? Exception 
      expected_format 
    else
      object.to_s
    end
  }
end

.regexObject



95
96
97
# File 'lib/greenpepper/converter.rb', line 95

def self.regex
  /^[\s]*error[\s]*$/i
end