Class: Magnum::Payload::Base
- Inherits:
-
Object
- Object
- Magnum::Payload::Base
- Includes:
- MessageParser
- Defined in:
- lib/magnum/payload/base.rb
Constant Summary collapse
- GIT_ZERO_SHA =
/\A[0]{40}\z/
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.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/magnum/payload/base.rb', line 26 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
16 17 18 |
# File 'lib/magnum/payload/base.rb', line 16 def @author end |
#author_email ⇒ Object (readonly)
Commit SHA or ID
16 17 18 |
# File 'lib/magnum/payload/base.rb', line 16 def @author_email end |
#branch ⇒ Object (readonly)
Commit SHA or ID
16 17 18 |
# File 'lib/magnum/payload/base.rb', line 16 def branch @branch end |
#commit ⇒ Object (readonly)
Commit SHA or ID
16 17 18 |
# File 'lib/magnum/payload/base.rb', line 16 def commit @commit end |
#commit_url ⇒ Object (readonly)
Commit SHA or ID
16 17 18 |
# File 'lib/magnum/payload/base.rb', line 16 def commit_url @commit_url end |
#committer ⇒ Object (readonly)
Commit SHA or ID
16 17 18 |
# File 'lib/magnum/payload/base.rb', line 16 def committer @committer end |
#committer_email ⇒ Object (readonly)
Commit SHA or ID
16 17 18 |
# File 'lib/magnum/payload/base.rb', line 16 def committer_email @committer_email end |
#compare_url ⇒ Object (readonly)
Commit SHA or ID
16 17 18 |
# File 'lib/magnum/payload/base.rb', line 16 def compare_url @compare_url end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
11 12 13 |
# File 'lib/magnum/payload/base.rb', line 11 def data @data end |
#message ⇒ Object (readonly)
Commit SHA or ID
16 17 18 |
# File 'lib/magnum/payload/base.rb', line 16 def @message end |
#raw_data ⇒ Object (readonly)
Returns the value of attribute raw_data.
11 12 13 |
# File 'lib/magnum/payload/base.rb', line 11 def raw_data @raw_data end |
#skip ⇒ Object (readonly)
Flag to indicate payload skip
13 14 15 |
# File 'lib/magnum/payload/base.rb', line 13 def skip @skip end |
#test ⇒ Object (readonly)
Flag to indicate payload skip
13 14 15 |
# File 'lib/magnum/payload/base.rb', line 13 def test @test end |
Instance Method Details
#attributes_hash ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/magnum/payload/base.rb', line 37 def attributes_hash { "commit" => commit, "branch" => branch, "author" => , "committer" => committer, "message" => , "commit_url" => commit_url, "compare_url" => compare_url } end |
#parse! ⇒ Object
49 50 51 |
# File 'lib/magnum/payload/base.rb', line 49 def parse! raise "Not implemented in base class" end |
#skip? ⇒ Boolean
53 54 55 |
# File 'lib/magnum/payload/base.rb', line 53 def skip? skip == true end |