Exception: Ruote::Reader::Error

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/ruote/reader.rb

Overview

This error is emitted by the reader when it failed to read a process definition (passed as a string).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(definition) ⇒ Error

Returns a new instance of Error.



53
54
55
# File 'lib/ruote/reader.rb', line 53

def initialize(definition)
  @definition = definition
end

Instance Attribute Details

#definitionObject (readonly)

Returns the value of attribute definition.



50
51
52
# File 'lib/ruote/reader.rb', line 50

def definition
  @definition
end

#jsonObject (readonly)

Returns the value of attribute json.



51
52
53
# File 'lib/ruote/reader.rb', line 51

def json
  @json
end

#radialObject (readonly)

Returns the value of attribute radial.



51
52
53
# File 'lib/ruote/reader.rb', line 51

def radial
  @radial
end

#rubyObject (readonly)

Returns the value of attribute ruby.



51
52
53
# File 'lib/ruote/reader.rb', line 51

def ruby
  @ruby
end

#xmlObject (readonly)

Returns the value of attribute xml.



51
52
53
# File 'lib/ruote/reader.rb', line 51

def xml
  @xml
end

Instance Method Details

#<<(args) ⇒ Object



57
58
59
60
61
# File 'lib/ruote/reader.rb', line 57

def <<(args)
  type, error = args
  type = type.to_s.match(/^Ruote::(.+)Reader$/)[1].downcase
  instance_variable_set("@#{type}", error)
end

#causeObject

Returns the most likely error cause…



65
66
67
# File 'lib/ruote/reader.rb', line 65

def cause
  @ruby || @radial || @xml || @json
end

#inspectObject



69
70
71
72
73
74
# File 'lib/ruote/reader.rb', line 69

def inspect
  s = "#<#{self.class}: "
  [ @ruby, @radial, @xml, @json ].each { |e| s << e.inspect; s << ' ' }
  s << '>'
  s
end