Sha256: ecc0f695da8e1a73b1d0ff1e03777c32f44b9ea82414d9cf92108efd1c53fdd4

Contents?: true

Size: 904 Bytes

Versions: 12

Compression:

Stored size: 904 Bytes

Contents

module Searchgasm
  module Modifiers
    class Base
      class << self
        # A convenience method for the name of this modifier
        def modifier_name
          name.split("::").last.underscore
        end
        
        # The various names for the modifier. The first in the array is the "main" name, the rest are just aliases to the "main" name
        def modifier_names
          [modifier_name]
        end
        
        # The method in the connection adapter that creates the SQL for the modifier
        def adapter_method_name
          "#{modifier_name}_sql"
        end
        
        # The type of value returned from the SQL. A class the extends this MUST define this method.
        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
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
searchgasm-1.3.0 lib/searchgasm/modifiers/base.rb
searchgasm-1.3.3 lib/searchgasm/modifiers/base.rb
searchgasm-1.3.1 lib/searchgasm/modifiers/base.rb
searchgasm-1.3.4 lib/searchgasm/modifiers/base.rb
searchgasm-1.3.2 lib/searchgasm/modifiers/base.rb
searchgasm-1.5.3 lib/searchgasm/modifiers/base.rb
searchgasm-1.4.1 lib/searchgasm/modifiers/base.rb
searchgasm-1.5.0 lib/searchgasm/modifiers/base.rb
searchgasm-1.4.0 lib/searchgasm/modifiers/base.rb
searchgasm-1.3.5 lib/searchgasm/modifiers/base.rb
searchgasm-1.5.1 lib/searchgasm/modifiers/base.rb
searchgasm-1.5.2 lib/searchgasm/modifiers/base.rb