Sha256: a917e3d6469803bc9a64216738edef7e1bfefc55eb0a135def8245662113a3ed
Contents?: true
Size: 925 Bytes
Versions: 10
Compression:
Stored size: 925 Bytes
Contents
module Janky module GitHub class Payload def self.parse(json) parsed = PayloadParser.new(json) new(parsed.uri, parsed.branch, parsed.head, parsed.pusher, parsed.commits, parsed.compare) end def initialize(uri, branch, head, pusher, commits, compare) @uri = uri @branch = branch @head = head @pusher = pusher @commits = commits @compare = compare end attr_reader :uri, :branch, :head, :pusher, :commits, :compare def head_commit @commits.detect do |commit| commit.sha1 == @head end end def to_json { :after => @head, :ref => "refs/heads/#{@branch}", :pusher => {:name => @pusher}, :uri => @uri, :commits => @commits, :compare => @compare }.to_json end end end end
Version data entries
10 entries across 10 versions & 1 rubygems