This class is used for case-insensitive orders. It is derived from the Order class where you can find more information on usage.

Methods
Public Class methods
new( *fields )

Creates a new instance of Lower and flattens the given parameter fields. Raises Error if presented with fields that are either instances of Order::Asc or Order::Desc.

Usage:

  Momomoto::Order::Lower.new(:author, [:title, :publisher])
# File lib/momomoto/order.rb, line 77
      def initialize( *fields )
        fields = fields.flatten
        fields.each do | field |
          raise Error, "Asc and Desc are only allowed as toplevel order elements" if field.kind_of?( Asc ) or field.kind_of?( Desc )
        end
        @fields = fields
      end
Public Instance methods
function( argument )

Translates all +argument+s to the SQL statement. Returns the joined arguments.

# File lib/momomoto/order.rb, line 87
      def function( argument )
        argument = [ argument ] if not argument.kind_of?( Array )
        argument = argument.map{|a| "lower(#{a})"}
        argument.join(',')
      end