module Whowas::Adapter
Public Instance Methods
search(input)
click to toggle source
All adapters use (adapter_instance).search as the only public method and follow the pattern below. Validation and formatting are optional. search_api
must contain the core api search code and return the results.
# File lib/whowas/adapter.rb, line 7 def search(input) validate(input) input = format(input) search_api(input) end
Private Instance Methods
format(input)
click to toggle source
# File lib/whowas/adapter.rb, line 21 def format(input) input end
search_api(input)
click to toggle source
MUST be overridden (core search functionality)
# File lib/whowas/adapter.rb, line 26 def search_api(input) raise Errors::SubclassResponsibility end
validate(input)
click to toggle source
default methods for adapters to use or override
:nocov:
# File lib/whowas/adapter.rb, line 17 def validate(input) true end