Class: InterMine::PathQuery::MultiValueConstraint

Inherits:
Object
  • Object
show all
Includes:
AttributeConstraint, Coded, PathFeature
Defined in:
lib/intermine/query.rb

Instance Attribute Summary collapse

Attributes included from Coded

#code, #op

Attributes included from PathFeature

#path

Class Method Summary collapse

Instance Method Summary collapse

Methods included from AttributeConstraint

#coerce_value, #validate_value

Instance Attribute Details

#valuesObject

Returns the value of attribute values


1339
1340
1341
# File 'lib/intermine/query.rb', line 1339

def values
  @values
end

Class Method Details

.valid_opsObject


1335
1336
1337
# File 'lib/intermine/query.rb', line 1335

def self.valid_ops 
    return ["ONE OF", "NONE OF"]
end

Instance Method Details

#to_elemObject


1340
1341
1342
1343
1344
1345
1346
1347
1348
# File 'lib/intermine/query.rb', line 1340

def to_elem 
    elem = super
    @values.each { |x|
        value = REXML::Element.new("value")
        value.add_text(x.to_s)
        elem.add_element(value)
    }
    return elem
end

#validateObject


1350
1351
1352
1353
1354
1355
1356
# File 'lib/intermine/query.rb', line 1350

def validate
    super
    @values.map! {|val| coerce_value(val)}
    @values.each do |val|
        validate_value(val)
    end
end