Class: RailsAgnosticModels::ArelTranslator::Translator

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_agnostic_models/arel_translator/translator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(search_hash) ⇒ Translator

Returns a new instance of Translator.



8
9
10
11
# File 'lib/rails_agnostic_models/arel_translator/translator.rb', line 8

def initialize(search_hash)
  @search_hash = search_hash
  @arel_string = ""
end

Instance Attribute Details

#arel_stringObject

Returns the value of attribute arel_string.



6
7
8
# File 'lib/rails_agnostic_models/arel_translator/translator.rb', line 6

def arel_string
  @arel_string
end

#search_hashObject

Returns the value of attribute search_hash.



6
7
8
# File 'lib/rails_agnostic_models/arel_translator/translator.rb', line 6

def search_hash
  @search_hash
end

Instance Method Details

#translate!Object



13
14
15
16
# File 'lib/rails_agnostic_models/arel_translator/translator.rb', line 13

def translate!
  options_to_arel(search_hash)
  arel_string
end