Class: Hubload
- Inherits:
-
Object
- Object
- Hubload
- 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
-
#after ⇒ Object
Returns the value of attribute after.
-
#before ⇒ Object
Returns the value of attribute before.
-
#commits ⇒ Object
Returns the value of attribute commits.
-
#ref ⇒ Object
Returns the value of attribute ref.
-
#repo ⇒ Object
Returns the value of attribute repo.
Instance Method Summary collapse
-
#initialize(payload) ⇒ Hubload
constructor
A new instance of Hubload.
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
#after ⇒ Object
Returns the value of attribute after.
9 10 11 |
# File 'lib/hubload.rb', line 9 def after @after end |
#before ⇒ Object
Returns the value of attribute before.
9 10 11 |
# File 'lib/hubload.rb', line 9 def before @before end |
#commits ⇒ Object
Returns the value of attribute commits.
9 10 11 |
# File 'lib/hubload.rb', line 9 def commits @commits end |
#ref ⇒ Object
Returns the value of attribute ref.
9 10 11 |
# File 'lib/hubload.rb', line 9 def ref @ref end |
#repo ⇒ Object
Returns the value of attribute repo.
9 10 11 |
# File 'lib/hubload.rb', line 9 def repo @repo end |