Sha256: 4165759cf86bd77cfb31e79577eda194cea6eeeadc4b73ac3cf793fcdec25187

Contents?: true

Size: 1.64 KB

Versions: 1

Compression:

Stored size: 1.64 KB

Contents

require 'App42Response.rb'

module App42
  module AppTab
    #
    # An enum that contains the Currency Unit to be mentioned in the Bill.
    #
    class Currency < App42Response
      unless (const_defined?(:USD))
        USD = "USD"
      end
      unless (const_defined?(:EUR))
        EUR = "EUR"
      end
      unless (const_defined?(:INR))
        INR = "INR"
      end
      unless (const_defined?(:YEN))
        YEN = "YEN"
      end
      unless (const_defined?(:GBP))
        GBP = "GBP"
      end
      unless (const_defined?(:ASD))
        ASD = "ASD"
      end
      unless (const_defined?(:CAD))
        CAD = "CAD"
      end
      unless (const_defined?(:NZD))
        NZD = "NZD"
      end
      unless (const_defined?(:CNY))
        CNY = "CNY"
      end

      #
      # Sets the value of the CurrencyUnit.
      #
      # @param value
      #      - the value of CurrencyUnit
      #
      def enum(string)
        return Currency.const_get(string)
      end

      #
      # Returns the value of the CurrencyUnit.
      #
      # @return the value of CurrencyUnit.
      #

      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

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
App42_RUBY_SDK-0.8.3 lib/appTab/Currency.rb