Class: Magnum::Payload::Base
- Inherits:
-
Object
- Object
- Magnum::Payload::Base
- Includes:
- MessageParser
- Defined in:
- lib/magnum/payload/base.rb
Constant Summary
Constants included from MessageParser
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Commit SHA or ID.
-
#author_email ⇒ Object
readonly
Commit SHA or ID.
-
#branch ⇒ Object
readonly
Commit SHA or ID.
-
#commit ⇒ Object
readonly
Commit SHA or ID.
-
#commit_url ⇒ Object
readonly
Commit SHA or ID.
-
#committer ⇒ Object
readonly
Commit SHA or ID.
-
#committer_email ⇒ Object
readonly
Commit SHA or ID.
-
#compare_url ⇒ Object
readonly
Commit SHA or ID.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#message ⇒ Object
readonly
Commit SHA or ID.
-
#raw_data ⇒ Object
readonly
Returns the value of attribute raw_data.
-
#skip ⇒ Object
readonly
Flag to indicate payload skip.
-
#test ⇒ Object
readonly
Flag to indicate payload skip.
Instance Method Summary collapse
- #attributes_hash ⇒ Object
-
#initialize(payload) ⇒ Base
constructor
A new instance of Base.
- #parse! ⇒ Object
- #skip? ⇒ Boolean
Methods included from MessageParser
Constructor Details
#initialize(payload) ⇒ Base
Returns a new instance of Base.
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/magnum/payload/base.rb', line 24 def initialize(payload) set_defaults @raw_data = payload @data = parse_payload(payload) parse! @skip = unless @skip end |
Instance Attribute Details
#author ⇒ Object (readonly)
Commit SHA or ID
14 15 16 |
# File 'lib/magnum/payload/base.rb', line 14 def @author end |
#author_email ⇒ Object (readonly)
Commit SHA or ID
14 15 16 |
# File 'lib/magnum/payload/base.rb', line 14 def @author_email end |
#branch ⇒ Object (readonly)
Commit SHA or ID
14 15 16 |
# File 'lib/magnum/payload/base.rb', line 14 def branch @branch end |
#commit ⇒ Object (readonly)
Commit SHA or ID
14 15 16 |
# File 'lib/magnum/payload/base.rb', line 14 def commit @commit end |
#commit_url ⇒ Object (readonly)
Commit SHA or ID
14 15 16 |
# File 'lib/magnum/payload/base.rb', line 14 def commit_url @commit_url end |
#committer ⇒ Object (readonly)
Commit SHA or ID
14 15 16 |
# File 'lib/magnum/payload/base.rb', line 14 def committer @committer end |
#committer_email ⇒ Object (readonly)
Commit SHA or ID
14 15 16 |
# File 'lib/magnum/payload/base.rb', line 14 def committer_email @committer_email end |
#compare_url ⇒ Object (readonly)
Commit SHA or ID
14 15 16 |
# File 'lib/magnum/payload/base.rb', line 14 def compare_url @compare_url end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
9 10 11 |
# File 'lib/magnum/payload/base.rb', line 9 def data @data end |
#message ⇒ Object (readonly)
Commit SHA or ID
14 15 16 |
# File 'lib/magnum/payload/base.rb', line 14 def @message end |
#raw_data ⇒ Object (readonly)
Returns the value of attribute raw_data.
9 10 11 |
# File 'lib/magnum/payload/base.rb', line 9 def raw_data @raw_data end |
#skip ⇒ Object (readonly)
Flag to indicate payload skip
11 12 13 |
# File 'lib/magnum/payload/base.rb', line 11 def skip @skip end |
#test ⇒ Object (readonly)
Flag to indicate payload skip
11 12 13 |
# File 'lib/magnum/payload/base.rb', line 11 def test @test end |
Instance Method Details
#attributes_hash ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/magnum/payload/base.rb', line 35 def attributes_hash { "commit" => commit, "branch" => branch, "author" => , "committer" => committer, "message" => , "commit_url" => commit_url, "compare_url" => compare_url } end |
#parse! ⇒ Object
47 48 49 |
# File 'lib/magnum/payload/base.rb', line 47 def parse! raise "Not implemented in base class" end |
#skip? ⇒ Boolean
51 52 53 |
# File 'lib/magnum/payload/base.rb', line 51 def skip? skip == true end |