Class: GitHub::Payload::Formatter::Parser
- Inherits:
-
Object
- Object
- GitHub::Payload::Formatter::Parser
- Defined in:
- lib/github/payload/formatter.rb
Instance Attribute Summary collapse
-
#payload ⇒ Object
Returns the value of attribute payload.
Instance Method Summary collapse
-
#initialize(payload) ⇒ Parser
constructor
A new instance of Parser.
- #summarizer ⇒ Object
- #summary_message ⇒ Object
- #summary_url ⇒ Object
Constructor Details
#initialize(payload) ⇒ Parser
Returns a new instance of Parser.
4 5 6 |
# File 'lib/github/payload/formatter.rb', line 4 def initialize(payload) @payload = payload end |
Instance Attribute Details
#payload ⇒ Object
Returns the value of attribute payload.
3 4 5 |
# File 'lib/github/payload/formatter.rb', line 3 def payload @payload end |
Instance Method Details
#summarizer ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/github/payload/formatter.rb', line 16 def summarizer @summarizer ||= case payload['event'] when 'push' PushEvent.new(payload) when 'create' CreateEvent.new(payload) when 'delete' DeleteEvent.new(payload) when 'public' PublicEvent.new(payload) when 'issues' IssuesEvent.new(payload) when 'pull_request' PullRequestEvent.new(payload) when 'issue_comment' IssueCommentEvent.new(payload) when 'pull_request_review_comment' warn 'unsupported payload type pull_request_review_comment' else puts payload['event'] end end |
#summary_message ⇒ Object
8 9 10 |
# File 'lib/github/payload/formatter.rb', line 8 def summarizer. end |
#summary_url ⇒ Object
12 13 14 |
# File 'lib/github/payload/formatter.rb', line 12 def summary_url summarizer.summary_url end |