This module contains additional symbol behaviour.
Get the symbol as a specification.
@example Get the symbol as a criteria.
:field.specify(value)
@param [ Object ] value The value of the criteria. @param [ true, false ] negating If the selection should be negated.
@return [ Hash ] The selection.
@since 1.0.0
# File lib/origin/extensions/symbol.rb, line 18 def specify(value, negating = false) (negating && value.regexp?) ? { self => { "$not" => value } } : { self => value } end
Get the symbol as a sort direction.
@example Get the symbol as a sort direction.
"1".to_direction
@return [ Integer ] The direction.
@since 1.0.0
# File lib/origin/extensions/symbol.rb, line 30 def to_direction to_s.to_direction end