Class: InterMine::PathQuery::SortOrder

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

Class Attribute Summary collapse

Instance Attribute Summary collapse

Attributes included from PathFeature

#path

Instance Method Summary collapse

Methods included from PathFeature

#validate

Constructor Details

#initialize(path, direction) ⇒ SortOrder

Returns a new instance of SortOrder.


1390
1391
1392
1393
1394
1395
1396
1397
# File 'lib/intermine/query.rb', line 1390

def initialize(path, direction) 
    direction = direction.to_s.upcase
    unless SortOrder.valid_directions.include? direction
        raise ArgumentError, "Illegal sort direction: #{direction}"
    end
    self.path = path
    self.direction = direction
end

Class Attribute Details

.valid_directionsObject

Returns the value of attribute valid_directions


1387
1388
1389
# File 'lib/intermine/query.rb', line 1387

def valid_directions
  @valid_directions
end

Instance Attribute Details

#directionObject

Returns the value of attribute direction


1386
1387
1388
# File 'lib/intermine/query.rb', line 1386

def direction
  @direction
end

Instance Method Details

#to_sObject


1399
1400
1401
# File 'lib/intermine/query.rb', line 1399

def to_s
    return @path.to_s + " " + @direction
end