Class: Stratify::GitHub::Event::DeleteEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/stratify-github/events.rb

Class Method Summary collapse

Class Method Details

.make(activity, api_hash) ⇒ Object



45
46
47
48
49
50
# File 'lib/stratify-github/events.rb', line 45

def self.make(activity, api_hash)
  activity.ref        = api_hash['payload']['ref']
  activity.ref_type   = api_hash['payload']['ref_type']
  activity.repository = api_hash['repository']['url'] rescue nil
  activity
end

.text(activity) ⇒ Object



51
52
53
54
# File 'lib/stratify-github/events.rb', line 51

def self.text(activity)
  repo = activity.repository ? "from #{activity.repository}" : ""
  "#{activity.actor} deleted #{activity.ref_type} #{activity.ref} #{repo}"
end