Class: GitHubRecordsArchiver::User

Inherits:
Object
  • Object
show all
Includes:
DataHelper
Defined in:
lib/github_records_archiver/user.rb

Constant Summary collapse

KEYS =
i[ site_admin type].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DataHelper

#method_missing, #respond_to_missing?, #to_h, #to_json

Constructor Details

#initialize(login_or_hash) ⇒ User

Returns a new instance of User.



10
11
12
13
14
15
16
17
# File 'lib/github_records_archiver/user.rb', line 10

def initialize()
  if .is_a? String
    @login = 
  else
    @login = [:login]
    @data = .to_h
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class GitHubRecordsArchiver::DataHelper

Instance Attribute Details

#loginObject (readonly) Also known as: name

Returns the value of attribute login.



3
4
5
# File 'lib/github_records_archiver/user.rb', line 3

def 
  @login
end

Instance Method Details

#dataObject



19
20
21
# File 'lib/github_records_archiver/user.rb', line 19

def data
  @data ||= GitHubRecordsArchiver.client.user 
end