Module: SymbolOperatorMethods

Included in:
SymbolOperator
Defined in:
lib/garb/core_ext/symbol.rb

Constant Summary collapse

OPERATORS =
{
  :eql     => '==',
  :not_eql => '!=',
  :gt      => '>',
  :gte     => '>=',
  :lt      => '<',
  :lte     => '<=',
  :matches => '==',
  
  :does_not_match   => '!=',
  :contains         => '=~',
  :does_not_contain => '!~',
  :substring        => '=@',
  :not_substring    => '!@',
  
  :desc       => '-',
  :descending => '-'
}
SLUGS =
OPERATORS.keys.freeze

Instance Method Summary collapse

Instance Method Details

#to_google_analyticsObject



22
23
24
25
26
27
# File 'lib/garb/core_ext/symbol.rb', line 22

def to_google_analytics
  t = Garb.to_google_analytics @field || @target
  o = OPERATORS[@operator]

  [:desc, :descending].include?(@operator) ? "#{o}#{t}" : "#{t}#{o}"
end