Class: Rev::OrderRequest

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

Overview

OrderRequest is used for constructing order ‘spec’ in consumer code and passing it into. It consists of three main elements: :payment, :transcription_options and :notification. You can also supply reference number, customer comment, and whether standard turnaround time is not required

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiSerializable

#to_hash, #to_json

Constructor Details

#initialize(fields = {}) ⇒ OrderRequest

Returns a new instance of OrderRequest.

Parameters:

  • fields (Hash) (defaults to: {})

    of fields to initialize instance. See instance attributes for available fields.



44
45
46
47
48
# File 'lib/rev-api/models/order_request.rb', line 44

def initialize(fields = {})
  fields = { :non_standard_tat_guarantee => false }.merge(fields)
  @payment = Rev::Payment.
  super fields
end

Instance Attribute Details

#caption_optionsObject (readonly)



20
21
22
# File 'lib/rev-api/models/order_request.rb', line 20

def caption_options
  @caption_options
end

#client_refObject (readonly)

a reference number for the order meaningful for the client (optional)



26
27
28
# File 'lib/rev-api/models/order_request.rb', line 26

def client_ref
  @client_ref
end

#commentObject (readonly)

a comment with any special messages about the order (optional)



29
30
31
# File 'lib/rev-api/models/order_request.rb', line 29

def comment
  @comment
end

#non_standard_tat_guaranteeObject (readonly)

a boolean flag specifying whether normal turnaround time is not required, defaults to false (optional)



32
33
34
# File 'lib/rev-api/models/order_request.rb', line 32

def non_standard_tat_guarantee
  @non_standard_tat_guarantee
end

#notificationObject (readonly)



23
24
25
# File 'lib/rev-api/models/order_request.rb', line 23

def notification
  @notification
end

#paymentObject (readonly)

see Payment



11
12
13
# File 'lib/rev-api/models/order_request.rb', line 11

def payment
  @payment
end

#transcription_optionsObject (readonly)



14
15
16
# File 'lib/rev-api/models/order_request.rb', line 14

def transcription_options
  @transcription_options
end

#translation_optionsObject (readonly)



17
18
19
# File 'lib/rev-api/models/order_request.rb', line 17

def translation_options
  @translation_options
end

Class Method Details

.new_with_payment(payment, fields = {}) ⇒ Object

Deprecated.

payment always defaults to :account_balance

Parameters:

  • payment (Payment)

    payment info

  • fields (Hash) (defaults to: {})

    of fields to initialize instance. See instance attributes for available fields.



37
38
39
40
41
# File 'lib/rev-api/models/order_request.rb', line 37

def self.new_with_payment(payment, fields = {})
  fields = { :non_standard_tat_guarantee => false }.merge(fields)
  super fields
  @payment = payment
end