class Dynamicloud::API::Criteria::OrderByClause

This class represents an OrderBy clause @author Eleazar Gomez @version 1.0.0 @since 8/23/15

Attributes

asc[RW]
attribute[RW]

Public Class Methods

asc(attribute) click to toggle source

Build an orderBy clause using asc flag @param attribute attribute to use to order @return an orderBy object

# File lib/dynamic_criteria.rb, line 418
def self.asc(attribute)
  order = OrderByClause.new
  order.asc = true
  order.attribute = attribute

  order
end
desc(attribute) click to toggle source

Build an orderBy clause using desc flag @param attribute attribute to use to order @return an orderBy object

# File lib/dynamic_criteria.rb, line 429
def self.desc(attribute)
  order = OrderByClause.new
  order.asc = false
  order.attribute = attribute

  order
end

Public Instance Methods

to_record_string(parent) click to toggle source

This method will return a String of this condition @param parent this is the parent of this condition @return a json

# File lib/dynamic_criteria.rb, line 440
def to_record_string(parent)
  '"order": "' + attribute + (asc ? ' ASC' : ' DESC') + '"'
end