class EZAPIClient::GenData

Constants

ALLOWED_CHARACTERS

Public Class Methods

call(attributes) click to toggle source
# File lib/ezapi_client/services/gen_data.rb, line 17
def self.call(attributes)
  self.new(attributes).()
end

Public Instance Methods

call() click to toggle source
# File lib/ezapi_client/services/gen_data.rb, line 21
def call
  if log
    logger.info(EZAPIClient::LOG_PROGNAME) { command }
    ExecCommand.(command, logger)
  else
    ExecCommand.(command)
  end
end

Private Instance Methods

default_command() click to toggle source
# File lib/ezapi_client/services/gen_data.rb, line 32
def default_command
  [
    "java -cp",
    JAR_PATH,
    "ezpadala.EZdata",
    prv_path,
    eks_path,
    username,
    password,
    reference_no,
    %Q('#{json}'),
  ].join(" ")
end
default_json() click to toggle source
# File lib/ezapi_client/services/gen_data.rb, line 46
def default_json
  message.each_with_object({}) do |(key, value), hash|
    hash[key.to_s.camelcase(:lower)] = strip_special_characters(value)
  end.to_json
end
strip_special_characters(value) click to toggle source
# File lib/ezapi_client/services/gen_data.rb, line 52
def strip_special_characters(value)
  return value if !value.is_a?(String)

  value.gsub(Regexp.new(ALLOWED_CHARACTERS), '')
end