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

Version Path
rhosync-2.1.18.beta2 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.18.beta1 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.17 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.17.beta7 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.17.beta6 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.17.beta5 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.17.beta4 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.17.beta3 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.17.beta2 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.17.beta1 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.16 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.15 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.14 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.13 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.12 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.11 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.10 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.7 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.6 spec/apps/rhotestapp/sources/simple_adapter.rb
rhosync-2.1.3 spec/apps/rhotestapp/sources/simple_adapter.rb