Class: Request::Payload::Github

Inherits:
Github::ServiceHook::Payload show all
Defined in:
lib/travis/model/request/payload/github.rb

Instance Attribute Summary

Attributes inherited from Github::ServiceHook::Payload

#payload

Instance Method Summary collapse

Methods inherited from Github::ServiceHook::Payload

#commits, #compare_url, #last_commit, #repository

Methods inherited from OpenStruct

#[], #[]=

Constructor Details

#initialize(data, token) ⇒ Github

Returns a new instance of Github.



6
7
8
9
# File 'lib/travis/model/request/payload/github.rb', line 6

def initialize(data, token)
  super(data)
  self.token = token
end

Instance Method Details

#attributesObject



11
12
13
# File 'lib/travis/model/request/payload/github.rb', line 11

def attributes
  { :source => source, :payload => payload, :commit => last_commit.to_hash, :token => token }
end

#reject?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/travis/model/request/payload/github.rb', line 15

def reject?
  no_commit? || repository.private? || skipped? || github_pages?
end