Exception: InterMine::Metadata::PathException

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/intermine/model.rb

Overview

An exception class for handling path parsing errors.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pathstring = nil, subclasses = {}, message = nil) ⇒ PathException

Returns a new instance of PathException.


887
888
889
890
891
# File 'lib/intermine/model.rb', line 887

def initialize(pathstring=nil, subclasses={}, message=nil)
    @pathstring = pathstring
    @subclasses = subclasses
    @message = message
end

Instance Attribute Details

#pathstringObject (readonly)

Returns the value of attribute pathstring


885
886
887
# File 'lib/intermine/model.rb', line 885

def pathstring
  @pathstring
end

#subclassesObject (readonly)

Returns the value of attribute subclasses


885
886
887
# File 'lib/intermine/model.rb', line 885

def subclasses
  @subclasses
end

Instance Method Details

#to_sObject

The string representation.


894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
# File 'lib/intermine/model.rb', line 894

def to_s
    if @pathstring.nil?
        if @message.nil?
            return self.class.name
        else
            return @message
        end
    end
    preamble = "Unable to resolve '#{@pathstring}': "
    footer = " (SUBCLASSES => #{@subclasses.inspect})"
    if @message.nil?
        return preamble + footer
    else
        return preamble + @message + footer
    end
end