Class: GitHub::Payload::Formatter::Event
- Inherits:
-
Object
- Object
- GitHub::Payload::Formatter::Event
- Includes:
- GitHub::Payload::Formatter
- Defined in:
- lib/github/payload/formatter.rb
Direct Known Subclasses
CreateEvent, DeleteEvent, IssueCommentEvent, IssuesEvent, PublicEvent, PullRequestEvent, PushEvent
Instance Attribute Summary collapse
-
#payload ⇒ Object
Returns the value of attribute payload.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(payload) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(payload) ⇒ Event
Returns a new instance of Event.
45 46 47 |
# File 'lib/github/payload/formatter.rb', line 45 def initialize(payload) @payload = payload['payload'] end |
Instance Attribute Details
#payload ⇒ Object
Returns the value of attribute payload.
44 45 46 |
# File 'lib/github/payload/formatter.rb', line 44 def payload @payload end |
Class Method Details
.objectify(hash) ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/github/payload/formatter.rb', line 49 def self.objectify(hash) struct = OpenStruct.new hash.each do |key, value| struct.send("#{key}=", value.is_a?(Hash) ? objectify(value) : value) end struct end |