Class: GitHubRecordsArchiver::User
- Inherits:
-
Object
- Object
- GitHubRecordsArchiver::User
- Includes:
- DataHelper
- Defined in:
- lib/github_records_archiver/user.rb
Constant Summary collapse
- KEYS =
i[login site_admin type].freeze
Instance Attribute Summary collapse
-
#login ⇒ Object
(also: #name)
readonly
Returns the value of attribute login.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(login_or_hash) ⇒ User
constructor
A new instance of User.
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(login_or_hash) if login_or_hash.is_a? String @login = login_or_hash else @login = login_or_hash[:login] @data = login_or_hash.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
#login ⇒ Object (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 @login end |
Instance Method Details
#data ⇒ Object
19 20 21 |
# File 'lib/github_records_archiver/user.rb', line 19 def data @data ||= GitHubRecordsArchiver.client.user login end |