Class: Searchgasm::Modifiers::Base
- Inherits:
-
Object
- Object
- Searchgasm::Modifiers::Base
- Defined in:
- lib/searchgasm/modifiers/base.rb
Direct Known Subclasses
Absolute, Acos, Asin, Atan, Ceil, CharLength, Cos, Cot, DayOfMonth, DayOfWeek, DayOfYear, Degrees, Exp, Floor, Hex, Hour, Log, Log10, Log2, Lower, Ltrim, Md5, Microseconds, Milliseconds, Minute, Month, Octal, Radians, Round, Rtrim, Second, Sign, Sin, SquareRoot, Tan, Trim, Upper, Week, Year
Class Method Summary collapse
-
.adapter_method_name ⇒ Object
The method in the connection adapter that creates the SQL for the modifier.
-
.modifier_name ⇒ Object
A convenience method for the name of this modifier.
-
.modifier_names ⇒ Object
The various names for the modifier.
-
.return_type ⇒ Object
The type of value returned from the SQL.
Class Method Details
.adapter_method_name ⇒ Object
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_name ⇒ Object
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_names ⇒ Object
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_type ⇒ Object
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 |