Sha256: 83a8f00589d8e4a62cd707306c5c0a528f62e35e497702f33cd19056e4146cf2
Contents?: true
Size: 773 Bytes
Versions: 48
Compression:
Stored size: 773 Bytes
Contents
class SimpleAdapter < SourceAdapter def initialize(source,credential) super(source,credential) end def login unless _is_empty?(current_user.login) true else raise SourceAdapterLoginException.new('Error logging in') end end def query(params=nil) @result end def search(params=nil,txt='') params[:foo] = 'bar' # this is for 'chaining' test if params['search'] == 'bar' @result = {'obj'=>{'foo'=>'bar'}} # this is for 'chaining' test, addind 'iPhone' to trogger Sample adapter search result params['name'] = 'iPhone' end @result end def sync super end def create(name_value_list,blob=nil) 'obj4' end private def _is_empty?(str) str.length <= 0 end end
Version data entries
48 entries across 48 versions & 1 rubygems