Sha256: 6e73cd28687d08274335431931c0da4d59645fad7dc2f2f65ead70a4c919a66c

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

module Rtml
  module Test
    module BuiltinVariables
      def self.add_variable(name, options) #:nodoc:
        options = { :type => options } if !options.kind_of?(Hash)
        BUILTIN_VARIABLES[name] = options
      end

      BUILTIN_VARIABLES = {}
      add_variable('card.cardholder_name', :string)
      add_variable('card.effective_date', :date)
      add_variable('card.expiry_date', :date)
      add_variable('card.input_type', :integer)
      add_variable('card.issue_number', :integer)
      add_variable('card.issuer_name', :string)
      add_variable('card.scheme', :string)
      add_variable('card.pan', :integer)
      add_variable('card.parser.type', :string)
      add_variable('card.parser.verdict', :string)
      add_variable('card.parser.reject_reason', :string)
      
      add_variable('payment.amount', :integer)
      add_variable('payment.amount_other', :integer)
      BUILTIN_VARIABLES.freeze

      def declare_builtin_variables!
        BUILTIN_VARIABLES.each do |name, options|
          declare_variable(name, options)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rtml-2.0.4 lib/rtml/test/builtin_variables.rb