Method: InterMine::PathQuery::Query#get_constraint

Defined in:
lib/intermine/query.rb

#get_constraint(code) ⇒ Object

Get the constraint on the query with the given code. Raises an error if there is no such constraint.

Raises:

  • (ArgumentError)


473
474
475
476
477
478
479
480
# File 'lib/intermine/query.rb', line 473

def get_constraint(code)
    @constraints.each do |x|
        if x.respond_to?(:code) and x.code == code
            return x
        end
    end
    raise ArgumentError, "#{code} not in query"
end