class Right::SortParameterDefinition
Sorting parameter definition
Attributes
as[R]
If the property name doesn't match the name in the query string, use the :as option @return [String]
name[R]
@return [String]
reverse_direction[R]
@return [Boolean]
reverse_direction?[R]
@return [Boolean]
Public Class Methods
new(name, as: name, reverse_direction: false)
click to toggle source
@param [String] name of the field @param [String] as (name
) alias for the property @param [Boolean] reverse_direction
(false) default sorting direction
# File lib/right/sort_parameter_definition.rb, line 20 def initialize(name, as: name, reverse_direction: false) @name = name.to_s @as = as.to_s @reverse_direction = reverse_direction end
Public Instance Methods
==(other)
click to toggle source
# File lib/right/sort_parameter_definition.rb, line 33 def ==(other) other.is_a?(self.class) && other.name == name && other.as == as end
defined?()
click to toggle source
# File lib/right/sort_parameter_definition.rb, line 45 def defined? true end
eql?(other)
click to toggle source
# File lib/right/sort_parameter_definition.rb, line 29 def eql?(other) other.is_a?(self.class) && other.name == name end
undefined?()
click to toggle source
# File lib/right/sort_parameter_definition.rb, line 49 def undefined? !self.defined? end
validator()
click to toggle source
# File lib/right/sort_parameter_definition.rb, line 41 def validator SortValueValidator.build(self).new end