Sha256: 2242ee7867d0bca2401fe40f8d7fbe66b90e74a7660a6fe230a276c40d65cbbc
Contents?: true
Size: 592 Bytes
Versions: 1
Compression:
Stored size: 592 Bytes
Contents
module SQLTree::Node class Ordering < Base attr_accessor :expression, :direction def initialize(expression, direction = nil) @expression, @direction = expression, direction end def to_sql sql = expression.to_sql sql << " #{direction.to_s.upcase}" if direction sql end def self.parse(tokens) ordering = self.new(SQLTree::Node::Expression.parse(tokens)) if tokens.peek && tokens.peek.direction? ordering.direction = tokens.next.literal.downcase.to_sym end return ordering end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sql_tree-0.0.2 | lib/sql_tree/node/ordering.rb |