Class: Travis::Notifications::Webhook::Payload
- Inherits:
-
Object
- Object
- Travis::Notifications::Webhook::Payload
- Defined in:
- lib/travis/notifications/webhook/payload.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
- #base_dir ⇒ Object
-
#initialize(object) ⇒ Payload
constructor
A new instance of Payload.
- #render(format) ⇒ Object
- #template ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(object) ⇒ Payload
Returns a new instance of Payload.
7 8 9 |
# File 'lib/travis/notifications/webhook/payload.rb', line 7 def initialize(object) @object = object end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
5 6 7 |
# File 'lib/travis/notifications/webhook/payload.rb', line 5 def object @object end |
Instance Method Details
#base_dir ⇒ Object
23 24 25 |
# File 'lib/travis/notifications/webhook/payload.rb', line 23 def base_dir File.('../views', __FILE__) end |
#render(format) ⇒ Object
15 16 17 |
# File 'lib/travis/notifications/webhook/payload.rb', line 15 def render(format) Travis::Renderer.send(format, object, :type => :webhook, :template => template, :base_dir => base_dir) end |
#template ⇒ Object
19 20 21 |
# File 'lib/travis/notifications/webhook/payload.rb', line 19 def template object.class.name.underscore end |
#to_hash ⇒ Object
11 12 13 |
# File 'lib/travis/notifications/webhook/payload.rb', line 11 def to_hash render(:hash) end |