Class: GHArchive::PushEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/gh-archive/events.rb

Constant Summary

Constants inherited from Event

Event::IMPLEMENTATIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Event

#actor, #created_at, #initialize, #json, parse, #public?, #repo

Constructor Details

This class inherits a constructor from GHArchive::Event

Class Method Details

.fits?(json) ⇒ Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/gh-archive/events.rb', line 46

def self.fits?(json)
    json['type'] == "PushEvent"
end

Instance Method Details

#beforeObject



66
67
68
# File 'lib/gh-archive/events.rb', line 66

def before
    @payload['before']
end

#commitsObject



70
71
72
# File 'lib/gh-archive/events.rb', line 70

def commits
    @payload['commits'].map { |c| Commit.new(c) }
end

#distinct_sizeObject



58
59
60
# File 'lib/gh-archive/events.rb', line 58

def distinct_size
    @payload['distinct_size']
end

#headObject



62
63
64
# File 'lib/gh-archive/events.rb', line 62

def head
    @payload['head']
end

#push_idObject



50
51
52
# File 'lib/gh-archive/events.rb', line 50

def push_id
    @payload['push_id']
end

#sizeObject



54
55
56
# File 'lib/gh-archive/events.rb', line 54

def size
    @payload['size']
end