Sha256: 4babffebfb7d0adee97cac2362f4d051bb4e9de4147506367def210e155c3cdc

Contents?: true

Size: 676 Bytes

Versions: 10

Compression:

Stored size: 676 Bytes

Contents

# -*- encoding : utf-8 -*-
class SklikApi
  class Client

    NAME = "client"

    include Object
        
    def initialize args = {}
      super args
    end
    
    def self.find args = {}
      out = connection.call("client.getAttributes") { |param|
        ([param[:user]]|param[:foreignAccounts]).collect{|u| 
          u.symbolize_keys!
          SklikApi::Client.new(
            :customer_id => u[:userId],
            :email => u[:username]
          )
        }
      }
      out.select!{|c| c.args[:customer_id] == args[:customer_id]} if args[:customer_id]
      out.select!{|c| c.args[:email] == args[:email]} if args[:email]
      return out
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sklik-api-0.0.11 lib/sklik-api/client.rb
sklik-api-0.0.10 lib/sklik-api/client.rb
sklik-api-0.0.9 lib/sklik-api/client.rb
sklik-api-0.0.8 lib/sklik-api/client.rb
sklik-api-0.0.7 lib/sklik-api/client.rb
sklik-api-0.0.6 lib/sklik-api/client.rb
sklik-api-0.0.5 lib/sklik-api/client.rb
sklik-api-0.0.4 lib/sklik-api/client.rb
sklik-api-0.0.3 lib/sklik-api/client.rb
sklik-api-0.0.2 lib/sklik-api/client.rb