Class: Sorted::ActiveRecord::Builder

Inherits:
Struct
  • Object
show all
Defined in:
lib/sorted/activerecord/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#orderObject

Returns the value of attribute order

Returns:

  • (Object)

    the current value of order



5
6
7
# File 'lib/sorted/activerecord/builder.rb', line 5

def order
  @order
end

#quoterObject

Returns the value of attribute quoter

Returns:

  • (Object)

    the current value of quoter



5
6
7
# File 'lib/sorted/activerecord/builder.rb', line 5

def quoter
  @quoter
end

#sortObject

Returns the value of attribute sort

Returns:

  • (Object)

    the current value of sort



5
6
7
# File 'lib/sorted/activerecord/builder.rb', line 5

def sort
  @sort
end

Instance Method Details

#setObject



14
15
16
# File 'lib/sorted/activerecord/builder.rb', line 14

def set
  uri + (sql - uri)
end

#sqlObject



10
11
12
# File 'lib/sorted/activerecord/builder.rb', line 10

def sql
  ::Sorted::SQLQuery.parse(order)
end

#to_sObject



18
19
20
# File 'lib/sorted/activerecord/builder.rb', line 18

def to_s
  ::Sorted::SQLQuery.encode(set, quoter)
end

#uriObject



6
7
8
# File 'lib/sorted/activerecord/builder.rb', line 6

def uri
  ::Sorted::URIQuery.parse(sort)
end