Class: Searchgasm::Modifiers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/searchgasm/modifiers/base.rb

Class Method Summary collapse

Class Method Details

.adapter_method_nameObject

The method in the connection adapter that creates the SQL for the modifier



16
17
18
# File 'lib/searchgasm/modifiers/base.rb', line 16

def adapter_method_name
  "#{modifier_name}_sql"
end

.modifier_nameObject

A convenience method for the name of this modifier



6
7
8
# File 'lib/searchgasm/modifiers/base.rb', line 6

def modifier_name
  name.split("::").last.underscore
end

.modifier_namesObject

The various names for the modifier. The first in the array is the “main” name, the rest are just aliases to the “main” name



11
12
13
# File 'lib/searchgasm/modifiers/base.rb', line 11

def modifier_names
  [modifier_name]
end

.return_typeObject

The type of value returned from the SQL. A class the extends this MUST define this method.



21
22
23
# File 'lib/searchgasm/modifiers/base.rb', line 21

def return_type
  raise "You did not specify a return type for the #{modifier_name} modifier. Please specify if it is an :integer, :string, etc."
end