Sha256: 7153a52eefe8b582b7f19de5b55c1e3823c8d07234d02a7341dd97a458e45aed

Contents?: true

Size: 925 Bytes

Versions: 5

Compression:

Stored size: 925 Bytes

Contents

module SynapsePayments
  class Nodes

    def initialize(client, user_id, oauth_key, fingerprint)
      @client = client
      @user_id = user_id
      @oauth_key = oauth_key
      @fingerprint = fingerprint
    end

    def all
      @client.get(path: "/users/#{@user_id}/nodes", oauth_key: @oauth_key, fingerprint: @fingerprint)
    end

    def find(id)
      @client.get(path: "/users/#{@user_id}/nodes/#{id}", oauth_key: @oauth_key, fingerprint: @fingerprint)
    end

    def create(data)
      @client.post(path: "/users/#{@user_id}/nodes", oauth_key: @oauth_key, fingerprint: @fingerprint, json: data)
    end

    def delete(id)
      @client.delete(path: "/users/#{@user_id}/nodes/#{id}", oauth_key: @oauth_key, fingerprint: @fingerprint)
    end

    def update(id, data)
      @client.patch(path: "/users/#{@user_id}/nodes/#{id}", oauth_key: @oauth_key, fingerprint: @fingerprint, json: data)
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
synapse_payments-0.10.1 lib/synapse_payments/nodes.rb
synapse_payments-0.10.0 lib/synapse_payments/nodes.rb
synapse_payments-0.9.0 lib/synapse_payments/nodes.rb
synapse_payments-0.8.1 lib/synapse_payments/nodes.rb
synapse_payments-0.8.0 lib/synapse_payments/nodes.rb