Class: GlobalCollect::Requests::ConvertAmount

Inherits:
Simple
  • Object
show all
Defined in:
lib/global_collect/requests/convert_amount.rb

Instance Attribute Summary

Attributes inherited from Base

#action, #version

Instance Method Summary collapse

Methods inherited from Simple

#to_xml

Methods inherited from Base

#default_xml_encoding_options, #to_xml

Constructor Details

#initialize(amount, source_currency, target_currency) ⇒ ConvertAmount

WDL §5.7



4
5
6
7
8
9
10
# File 'lib/global_collect/requests/convert_amount.rb', line 4

def initialize(amount, source_currency, target_currency)
  super("CONVERT_AMOUNT", {
    "AMOUNT"             => amount,
    "SOURCECURRENCYCODE" => source_currency,
    "TARGETCURRENCYCODE" => target_currency
  })
end

Instance Method Details

#fieldsObject



21
22
23
24
25
26
27
# File 'lib/global_collect/requests/convert_amount.rb', line 21

def fields
  {
    "AMOUNT"             => ["N12", "R"],
    "SOURCECURRENCYCODE" => ["AN3", "R"],
    "TARGETCURRENCYCODE" => ["AN3", "R"]
  }
end

#suggested_response_mixinsObject



12
13
14
15
16
17
# File 'lib/global_collect/requests/convert_amount.rb', line 12

def suggested_response_mixins
  [
    GlobalCollect::Responses::SuccessRow,
    GlobalCollect::Responses::ConvertAmount::ResponseMethods
  ]
end

#wrapperObject



19
# File 'lib/global_collect/requests/convert_amount.rb', line 19

def wrapper; "GENERAL"; end