Module: Portero::SearchProvider::InstanceMethods

Defined in:
lib/portero/search_provider.rb

Instance Method Summary collapse

Instance Method Details

#initialize(options = {}) ⇒ Object



23
24
25
26
# File 'lib/portero/search_provider.rb', line 23

def initialize(options = {})
  @provider_options = options
  validate_options
end

#search(connection, query, latitude, longitude, options = {}) ⇒ Object



28
29
30
# File 'lib/portero/search_provider.rb', line 28

def search(connection, query, latitude, longitude, options = {})
  self.class.api_not_implemented(self)
end

#validate_optionsObject



32
33
34
35
36
# File 'lib/portero/search_provider.rb', line 32

def validate_options
  self.class.required_options.each do |key|
    raise MissingRequirementError.new("#{self.class.name} needs an options hash key of '#{key}' to function") unless @provider_options.has_key?(key)
  end
end