Class: Rev::Notification

Inherits:
ApiSerializable show all
Defined in:
lib/rev-api/models/order_request.rb

Overview

Notification Info. Optionally you may request that an HTTP post be made to a url of your choice when the order enters a new status (eg being transcribed or reviewed) and when it is complete.

Constant Summary collapse

LEVELS =

Notification levels

{
  :detailed => 'Detailed',
  :final_only => 'FinalOnly'
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ApiSerializable

#to_hash, #to_json

Constructor Details

#initialize(url, level = nil) ⇒ Notification

Returns a new instance of Notification.

Parameters:

  • url (String)

    The url for notifications. Mandatory if the notifications element is used. Updates will be posted to this URL

  • level (String) (defaults to: nil)

    Optional, specifies which notifications are sent:

    • :detailed - a notification is sent whenever the order is in a new status or has a new comment

    • :final_only - (the default), notification is sent only when the order is complete



271
272
273
274
# File 'lib/rev-api/models/order_request.rb', line 271

def initialize(url, level = nil)
  @url = url
  @level = level ? level : LEVELS[:final_only]
end

Instance Attribute Details

#levelObject (readonly)

Returns the value of attribute level.



259
260
261
# File 'lib/rev-api/models/order_request.rb', line 259

def level
  @level
end

#urlObject (readonly)

Returns the value of attribute url.



259
260
261
# File 'lib/rev-api/models/order_request.rb', line 259

def url
  @url
end