Class: Hubload

Inherits:
Object
  • Object
show all
Defined in:
lib/hubload.rb,
lib/hubload/ref.rb,
lib/hubload/repo.rb,
lib/hubload/after.rb,
lib/hubload/before.rb,
lib/hubload/commit.rb

Defined Under Namespace

Classes: After, Before, Commit, Ref, Repo

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ Hubload

Returns a new instance of Hubload.



11
12
13
14
15
16
17
18
# File 'lib/hubload.rb', line 11

def initialize(payload)
  load_data = JSON.parse(payload)
  @ref = Hubload::Ref.new(load_data['ref'])
  @before = Hubload::Before.new(load_data['before'])
  @after = Hubload::After.new(load_data['after'])
  @repo = Hubload::Repo.new(load_data['repository'])
  @commits = parse_commits(load_data['commits'])
end

Instance Attribute Details

#afterObject

Returns the value of attribute after.



9
10
11
# File 'lib/hubload.rb', line 9

def after
  @after
end

#beforeObject

Returns the value of attribute before.



9
10
11
# File 'lib/hubload.rb', line 9

def before
  @before
end

#commitsObject

Returns the value of attribute commits.



9
10
11
# File 'lib/hubload.rb', line 9

def commits
  @commits
end

#refObject

Returns the value of attribute ref.



9
10
11
# File 'lib/hubload.rb', line 9

def ref
  @ref
end

#repoObject

Returns the value of attribute repo.



9
10
11
# File 'lib/hubload.rb', line 9

def repo
  @repo
end