Sha256: 54015b4656e2ddf31161c3b4fbae97aeaf560c56b5c024900699bcb6d1a95240

Contents?: true

Size: 393 Bytes

Versions: 10

Compression:

Stored size: 393 Bytes

Contents

module Onfido
  class API
    def method_missing(method, *args)
      klass = method.to_s.capitalize
      Object.const_get("Onfido::#{klass}").new
    rescue NameError
      super
    end

    def respond_to_missing?(method, include_private = false)
      klass = method.to_s.capitalize
      Object.const_get("Onfido::#{klass}")
      true
    rescue NameError
      super
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
onfido-0.6.0 lib/onfido/api.rb
onfido-0.5.0 lib/onfido/api.rb
onfido-0.4.0 lib/onfido/api.rb
onfido-0.3.0 lib/onfido/api.rb
onfido-0.2.0 lib/onfido/api.rb
onfido-0.1.0 lib/onfido/api.rb
onfido-0.0.4 lib/onfido/api.rb
onfido-0.0.3 lib/onfido/api.rb
onfido-0.0.2 lib/onfido/api.rb
onfido-0.0.1 lib/onfido/api.rb