Class: App42::AppTab::Currency

Inherits:
App42Response show all
Defined in:
lib/appTab/Currency.rb

Overview

An enum that contains the Currency Unit to be mentioned in the Bill.

Constant Summary collapse

USD =
"USD"
EUR =
"EUR"
INR =
"INR"
YEN =
"YEN"
GBP =
"GBP"
ASD =
"ASD"
CAD =
"CAD"
NZD =
"NZD"
CNY =
"CNY"

Instance Attribute Summary

Attributes inherited from App42Response

#isResponseSuccess, #strResponse, #totalRecords

Instance Method Summary collapse

Instance Method Details

#enum(string) ⇒ Object

Sets the value of the CurrencyUnit.

Parameters:

  • value
    • the value of CurrencyUnit



43
44
45
# File 'lib/appTab/Currency.rb', line 43

def enum(string)
  return Currency.const_get(string)
end

#isAvailable(string) ⇒ Object

Returns the value of the CurrencyUnit.

Returns:

  • the value of CurrencyUnit.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/appTab/Currency.rb', line 53

def isAvailable(string)
  if(string == "USD")
    return "USD"
  elsif(string == "EUR")
    return "EUR"
  elsif(string == "INR")
    return "INR"
  elsif(string == "YEN")
    return "YEN"
  elsif(string == "GBP")
    return "GBP"
  elsif(string == "ASD")
    return "ASD"
  elsif(string == "CAD")
    return "CAD"
  elsif(string == "NZD")
    return "NZD"
  elsif(string == "CNY")
    return "CNY";
  else
    return nil
  end
end