Module: Minfraud
- Defined in:
- lib/minfraud/request.rb,
lib/minfraud/version.rb,
lib/minfraud/minfraud.rb,
lib/minfraud/response.rb,
lib/minfraud/transaction.rb
Defined Under Namespace
Classes: ConfigurationError, Request, Response, ResponseError, Transaction, TransactionError
Constant Summary collapse
- VERSION =
"0.1.1"
Class Method Summary collapse
-
.configure {|_self| ... } ⇒ nil, ConfigurationError
May be used to configure using common block style:.
-
.has_required_configuration? ⇒ Boolean
Service URI.
-
.license_key ⇒ String?
Module attribute getter for license_key This is the MaxMind API consumer’s license key.
-
.license_key=(key) ⇒ String
Module attribute setter for license_key This is the MaxMind API consumer’s license key.
-
.requested_type ⇒ String?
Module attribute getter for requested_type minFraud service level (standard/premium).
-
.requested_type=(type) ⇒ String
Module attribute setter for requested_type Desired service level (standard/premium).
-
.uri ⇒ URI::HTTPS
MaxMind minFraud API service URI.
Class Method Details
.configure {|_self| ... } ⇒ nil, ConfigurationError
May be used to configure using common block style:
“‘ruby Minfraud.configure do |c|
c.license_key = 'abcd1234'
end “‘
22 23 24 25 26 27 |
# File 'lib/minfraud/minfraud.rb', line 22 def self.configure yield self unless has_required_configuration? raise ConfigurationError, 'You must set license_key so MaxMind can identify you' end end |
.has_required_configuration? ⇒ Boolean
Returns service URI.
67 68 69 |
# File 'lib/minfraud/minfraud.rb', line 67 def self.has_required_configuration? class_variable_defined?(:@@license_key) end |
.license_key ⇒ String?
Module attribute getter for license_key This is the MaxMind API consumer’s license key.
32 33 34 |
# File 'lib/minfraud/minfraud.rb', line 32 def self.license_key class_variable_defined?(:@@license_key) ? @@license_key : nil end |
.license_key=(key) ⇒ String
Module attribute setter for license_key This is the MaxMind API consumer’s license key. It is required for this gem to work.
41 42 43 |
# File 'lib/minfraud/minfraud.rb', line 41 def self.license_key=(key) @@license_key = key end |
.requested_type ⇒ String?
Module attribute getter for requested_type minFraud service level (standard/premium)
48 49 50 |
# File 'lib/minfraud/minfraud.rb', line 48 def self.requested_type class_variable_defined?(:@@requested_type) ? @@requested_type : nil end |
.requested_type=(type) ⇒ String
Module attribute setter for requested_type Desired service level (standard/premium)
56 57 58 |
# File 'lib/minfraud/minfraud.rb', line 56 def self.requested_type=(type) @@requested_type = type end |
.uri ⇒ URI::HTTPS
MaxMind minFraud API service URI
62 63 64 |
# File 'lib/minfraud/minfraud.rb', line 62 def self.uri @@uri ||= URI('https://minfraud.maxmind.com/app/ccv2r') end |