Class: Octogate::Event::Push
Instance Attribute Summary collapse
-
#after ⇒ Object
readonly
Returns the value of attribute after.
-
#before ⇒ Object
readonly
Returns the value of attribute before.
-
#commits ⇒ Object
readonly
Returns the value of attribute commits.
-
#compare ⇒ Object
readonly
Returns the value of attribute compare.
-
#created ⇒ Object
readonly
Returns the value of attribute created.
-
#deleted ⇒ Object
readonly
Returns the value of attribute deleted.
-
#forced ⇒ Object
readonly
Returns the value of attribute forced.
-
#head_commit ⇒ Object
readonly
Returns the value of attribute head_commit.
-
#pusher ⇒ Object
readonly
Returns the value of attribute pusher.
-
#ref ⇒ Object
readonly
Returns the value of attribute ref.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Model
Instance Attribute Details
#after ⇒ Object (readonly)
Returns the value of attribute after.
3 4 5 |
# File 'lib/octogate/events/push.rb', line 3 def after @after end |
#before ⇒ Object (readonly)
Returns the value of attribute before.
3 4 5 |
# File 'lib/octogate/events/push.rb', line 3 def before @before end |
#commits ⇒ Object (readonly)
Returns the value of attribute commits.
3 4 5 |
# File 'lib/octogate/events/push.rb', line 3 def commits @commits end |
#compare ⇒ Object (readonly)
Returns the value of attribute compare.
3 4 5 |
# File 'lib/octogate/events/push.rb', line 3 def compare @compare end |
#created ⇒ Object (readonly)
Returns the value of attribute created.
3 4 5 |
# File 'lib/octogate/events/push.rb', line 3 def created @created end |
#deleted ⇒ Object (readonly)
Returns the value of attribute deleted.
3 4 5 |
# File 'lib/octogate/events/push.rb', line 3 def deleted @deleted end |
#forced ⇒ Object (readonly)
Returns the value of attribute forced.
3 4 5 |
# File 'lib/octogate/events/push.rb', line 3 def forced @forced end |
#head_commit ⇒ Object (readonly)
Returns the value of attribute head_commit.
3 4 5 |
# File 'lib/octogate/events/push.rb', line 3 def head_commit @head_commit end |
#pusher ⇒ Object (readonly)
Returns the value of attribute pusher.
3 4 5 |
# File 'lib/octogate/events/push.rb', line 3 def pusher @pusher end |
#ref ⇒ Object (readonly)
Returns the value of attribute ref.
3 4 5 |
# File 'lib/octogate/events/push.rb', line 3 def ref @ref end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
3 4 5 |
# File 'lib/octogate/events/push.rb', line 3 def repository @repository end |
Class Method Details
.parse(json) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/octogate/events/push.rb', line 5 def parse(json) payload = Oj.load(json).deep_symbolize_keys commits = payload[:commits].map do |c| GH::Commit.new(c.symbolize_keys) end head_commit = payload[:head_commit] ? GH::Commit.new(payload[:head_commit]) : nil repository = GH::Repository.new(payload[:repository]) new( ref: payload[:ref], after: payload[:after], before: payload[:before], created: payload[:created], deleted: payload[:deleted], forced: payload[:forced], compare: payload[:compare], commits: commits, head_commit: head_commit, repository: repository, ) end |
Instance Method Details
#default_condition ⇒ Object
31 32 33 |
# File 'lib/octogate/events/push.rb', line 31 def default_condition !deleted end |