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.



864
865
866
867
868
# File 'lib/intermine/model.rb', line 864

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.



862
863
864
# File 'lib/intermine/model.rb', line 862

def pathstring
  @pathstring
end

#subclassesObject (readonly)

Returns the value of attribute subclasses.



862
863
864
# File 'lib/intermine/model.rb', line 862

def subclasses
  @subclasses
end

Instance Method Details

#to_sObject

The string representation.



871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
# File 'lib/intermine/model.rb', line 871

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