Class: GithubContributions::GithubObject
- Inherits:
-
Object
- Object
- GithubContributions::GithubObject
- Defined in:
- lib/github_contributions/github_object.rb
Overview
call these payloads?
Direct Known Subclasses
GithubContributions::GithubObjects::Comment, GithubContributions::GithubObjects::Issue, GithubContributions::GithubObjects::PullRequest, GithubContributions::GithubObjects::Review, GithubContributions::GithubObjects::User
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#eql?(other) ⇒ Boolean
ContributionGrouper uses these objects as keys in a hash We need to define the ‘hash` and `eql?` so they work correctly.
- #hash ⇒ Object
-
#initialize(data) ⇒ GithubObject
constructor
A new instance of GithubObject.
- #user ⇒ Object
Constructor Details
#initialize(data) ⇒ GithubObject
Returns a new instance of GithubObject.
6 7 8 |
# File 'lib/github_contributions/github_object.rb', line 6 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/github_contributions/github_object.rb', line 4 def data @data end |
Instance Method Details
#eql?(other) ⇒ Boolean
ContributionGrouper uses these objects as keys in a hash We need to define the ‘hash` and `eql?` so they work correctly
16 17 18 |
# File 'lib/github_contributions/github_object.rb', line 16 def eql?(other) hash == other.hash end |
#hash ⇒ Object
20 21 22 |
# File 'lib/github_contributions/github_object.rb', line 20 def hash data.html_url.hash end |
#user ⇒ Object
10 11 12 |
# File 'lib/github_contributions/github_object.rb', line 10 def user GithubObjects::User.new(data.user) end |