Module: Origin::Extensions::Symbol
- Defined in:
- lib/origin/extensions/symbol.rb
Overview
This module contains additional symbol behaviour.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#specify(value, negating = false) ⇒ Hash
Get the symbol as a specification.
-
#to_direction ⇒ Integer
Get the symbol as a sort direction.
Instance Method Details
#specify(value, negating = false) ⇒ Hash
Get the symbol as a specification.
19 20 21 |
# File 'lib/origin/extensions/symbol.rb', line 19 def specify(value, negating = false) (negating && value.regexp?) ? { self => { "$not" => value } } : { self => value } end |
#to_direction ⇒ Integer
Get the symbol as a sort direction.
31 32 33 |
# File 'lib/origin/extensions/symbol.rb', line 31 def to_direction to_s.to_direction end |