Module Origin::Extensions::String
In: lib/origin/extensions/string.rb

This module contains additional object behaviour.

Methods

Classes and Modules

Module Origin::Extensions::String::ClassMethods

Public Instance methods

Evolve the string into a mongodb friendly date.

@example Evolve the string.

  "2012-1-1".__evolve_date__

@return [ Time ] The time at UTC midnight.

@since 1.0.0

Evolve the string into a mongodb friendly time.

@example Evolve the string.

  "2012-1-1".__evolve_time__

@return [ Time ] The string as a time.

@since 1.0.0

Get the string as a specification.

@example Get the string as a criteria.

  "field".__expr_part__(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

Get the string as a mongo expression, adding $ to the front.

@example Get the string as an expression.

  "test".__mongo_expression__

@return [ String ] The string with $ at the front.

@since 2.0.0

Get the string as a sort option.

@example Get the string as a sort option.

  "field ASC".__sort_option__

@return [ Hash ] The string as a sort option hash.

@since 1.0.0

Get the string as a sort direction.

@example Get the string as a sort direction.

  "1".to_direction

@return [ Integer ] The direction.

@since 1.0.0

[Validate]