Sha256: bd787a37c2665f90cae72cf6ba13db7cac21463e5ee376d01fb596e2d10f5d59

Contents?: true

Size: 623 Bytes

Versions: 1

Compression:

Stored size: 623 Bytes

Contents

require 'heracles/wrapper/notification_response'
require 'delegate'

# Using the DelegateClass inheritance option so that the Preconditions of the
# base Heracles::Wrapper::NotificationResponse are preserved.
class <%= class_name %> < DelegateClass(Heracles::Wrapper::NotificationResponse)
  def initialize(params)
    super(Heracles::Wrapper::NotificationResponse.new(params))

    # The following two lines are logically equivalent
    #   @pid = fetch(:pid)
    #   @pid = params.fetch(:notification_payload).fetch(:pid)
  end
  # You may also want to define, at the class level the following:
  #   attr_reader :pid
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
heracles-wrapper-0.0.3 lib/rails/generators/heracles/wrapper/notification_response/templates/notification_response.rb.erb