Sha256: 375c9b0a5ccd94baf07d43509cb7be9ed1c59e327e5ce0b6f61af852ac089dd6

Contents?: true

Size: 712 Bytes

Versions: 4

Compression:

Stored size: 712 Bytes

Contents

module RubyRedtail
  class Contact
    class Account
      def initialize(contact_id, account_id, api_hash)
        @api_hash = api_hash
        @contact_id = contact_id
        @account_id = account_id
      end

      def fetch
        RubyRedtail::Query.run("contacts/#{@contact_id}/accounts", @api_hash, "GET")
      end

      def create (params)
        update(@contact_id, 0, params)
      end

      def update (account_id, params)
        RubyRedtail::Query.run("contacts/#{@contact_id}/accounts/#{account_id}", @api_hash, 'PUT', params)
      end

      def assets (account_id)
        RubyRedtail::Query.run("contacts/#{@contact_id}/#{account_id}/assets", @api_hash, "GET")
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-redtail-0.3.8 lib/ruby-redtail/contact/accounts.rb
ruby-redtail-0.3.7 lib/ruby-redtail/contact/accounts.rb
ruby-redtail-0.3.6 lib/ruby-redtail/contact/accounts.rb
ruby-redtail-0.3.5 lib/ruby-redtail/contact/accounts.rb