Sha256: 68412b355dcf514228a3fa0e64a1dd283b7c13d911a13b0a09eba49fe5bd3739

Contents?: true

Size: 702 Bytes

Versions: 1

Compression:

Stored size: 702 Bytes

Contents

module Velocity
  module Api
    class People < Velocity::Api::Base
      def fetch
        get("/people")
      end

      def update
        put("/people/#{args.fetch(:id)}", body)
      end

      private

      def body
        {
          body: {
            data: {
              id: args.fetch(:id),
              type: "people",
              relationships: relationships
            }
          }.to_json
        }
      end

      def relationships
        {
          teams: {
            data: args.fetch(:team_ids).map do |team_id|
              {
                type: "teams",
                id: team_id
              }
            end
          }
        }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
velocity_client_ruby-0.3.0 lib/velocity/api/people.rb