Class: Stratify::GitHub::Event::PushEvent
- Inherits:
-
Stratify::GitHub::Event
- Object
- Stratify::GitHub::Event
- Stratify::GitHub::Event::PushEvent
- Defined in:
- lib/stratify-github/events.rb
Class Method Summary collapse
Methods inherited from Stratify::GitHub::Event
Class Method Details
.make(activity, api_hash) ⇒ Object
192 193 194 195 196 197 198 |
# File 'lib/stratify-github/events.rb', line 192 def self.make(activity, api_hash) activity.action = "pushed" activity.ref = api_hash['payload']['ref'] activity.repository = api_hash['repository']['url'] rescue nil activity.payload = api_hash['payload']['shas'][0][2] rescue nil activity end |
.text(activity) ⇒ Object
199 200 201 202 |
# File 'lib/stratify-github/events.rb', line 199 def self.text(activity) payload = truncate(activity.payload, :length => 140) "#{activity.actor} pushed to #{activity.ref} on #{activity.repository} -- #{payload}" end |