Sha256: b8328ef62fc821a2687e90e8dd374537c4c39b9544e0559a8923c777b30d9fe0

Contents?: true

Size: 495 Bytes

Versions: 1

Compression:

Stored size: 495 Bytes

Contents

module Velocity
  class Contributor
    attr_accessor :id, :name, :email

    def initialize(id:, email:, name:)
      @id = id
      @email = email
      @name = name
    end

    def self.where(args)
      perform_request(args).map do |contributor|
        new(id: contributor["id"], name: contributor["attributes"]["name"], email: contributor["attributes"]["email"])
      end
    end

    def self.perform_request(args = {})
      Velocity::Api.new.fetch_contributors(args)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
velocity_client_ruby-0.1.1 lib/velocity/contributor.rb