Class: Octogate::Event::Push

Inherits:
Base
  • Object
show all
Defined in:
lib/octogate/events/push.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

register_event

Class Method Details

.parse(delivery_id, json) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/octogate/events/push.rb', line 12

def parse(delivery_id, json)
  payload = Oj.load(json).deep_symbolize_keys

  commits = payload[:commits].nil? ? [] : payload.delete(:commits).map do |c|
    GH::Commit.new(c.symbolize_keys)
  end

  attrs = payload.merge(delivery_id: delivery_id, commits: commits)

  new(attrs)
end

Instance Method Details

#default_conditionObject



25
26
27
# File 'lib/octogate/events/push.rb', line 25

def default_condition
  !deleted
end