Class: GithubContributions::Event
- Inherits:
-
Object
- Object
- GithubContributions::Event
show all
- Defined in:
- lib/github_contributions/event.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(data) ⇒ Event
Returns a new instance of Event.
5
6
7
|
# File 'lib/github_contributions/event.rb', line 5
def initialize(data)
@data = data
end
|
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
3
4
5
|
# File 'lib/github_contributions/event.rb', line 3
def data
@data
end
|
Instance Method Details
#action ⇒ Object
24
25
26
|
# File 'lib/github_contributions/event.rb', line 24
def action
data.payload.action.titleize
end
|
#actor ⇒ Object
16
17
18
|
# File 'lib/github_contributions/event.rb', line 16
def actor
GithubObjects::User.new(data.actor)
end
|
#created_at ⇒ Object
20
21
22
|
# File 'lib/github_contributions/event.rb', line 20
def created_at
data.created_at
end
|
#name ⇒ Object
28
29
30
|
# File 'lib/github_contributions/event.rb', line 28
def name
self.class.name.demodulize.sub("Event", "").singularize
end
|
#org ⇒ Object
12
13
14
|
# File 'lib/github_contributions/event.rb', line 12
def org
data.org&.login
end
|
#payload ⇒ Object
9
10
|
# File 'lib/github_contributions/event.rb', line 9
def payload
end
|