Sha256: a93fdfde2ae640ac4ecb8f1a15b270a64b9463360d07f5c1412a9a5146cfa902

Contents?: true

Size: 940 Bytes

Versions: 1

Compression:

Stored size: 940 Bytes

Contents

# encoding: utf-8
# frozen_string_literal: true
require 'cryptoprocessing/client'
require 'cryptoprocessing/default'

# Ruby module for to access Cryptoprocessing API
module Cryptoprocessing
  class << self
    include Cryptoprocessing::Configurable

    # API client based on configured options {Configurable}
    #
    # @return [Cryptoprocessing::Client] API wrapper
    def client
      return @client if defined?(@client) && @client.same_options?(options)
      @client = Cryptoprocessing::Client.new(options)
    end

    private

    def respond_to_missing?(method_name, include_private=false)
      client.respond_to?(method_name, include_private)
    end

    def method_missing(method_name, *args, &block)
      if client.respond_to?(method_name)
        return client.send(method_name, *args, &block)
      end

      super
    end
  end
end

Cryptoprocessing.setup

require 'cryptoprocessing/rails' if defined?(::Rails::Engine)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cryptoprocessing-0.6.1 lib/cryptoprocessing.rb