Sha256: e1058caa1be0f4a2e6ebc0483701a2d210750c1c14973c9f820455e982519a6b

Contents?: true

Size: 530 Bytes

Versions: 10

Compression:

Stored size: 530 Bytes

Contents

# frozen_string_literal: true

module HackerOne
  module Client
    class User
      include ResourceHelper

      delegate :username, :signal, :impact, :reputation, to: :attributes

      def self.find(username_we_want)
        user_json = make_get_request("users/#{username_we_want}")
        new(user_json)
      end

      def initialize(user)
        @user = user
      end

      def id
        @user[:id]
      end

      private

      def attributes
        OpenStruct.new(@user[:attributes])
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hackerone-client-0.23.0 lib/hackerone/client/user.rb
hackerone-client-0.22.1 lib/hackerone/client/user.rb
hackerone-client-0.22.0 lib/hackerone/client/user.rb
hackerone-client-0.21.0 lib/hackerone/client/user.rb
hackerone-client-0.20.1 lib/hackerone/client/user.rb
hackerone-client-0.20.0 lib/hackerone/client/user.rb
hackerone-client-0.19.0 lib/hackerone/client/user.rb
hackerone-client-0.18.0 lib/hackerone/client/user.rb
hackerone-client-0.17.0 lib/hackerone/client/user.rb
hackerone-client-0.16.0 lib/hackerone/client/user.rb