Module: Metropol

Defined in:
lib/metropol.rb,
lib/metropol/client.rb,
lib/metropol/default.rb,
lib/metropol/request.rb,
lib/metropol/version.rb,
lib/metropol/legal_id.rb,
lib/metropol/request/id_modifier.rb,
lib/metropol/request/report_reason.rb

Defined Under Namespace

Modules: Default, LegalId Classes: Client, Request

Constant Summary collapse

VERSION =
'0.1.0'.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_version=(value) ⇒ Object (writeonly)

Sets the attribute api_version

Parameters:

  • value

    the value to set the attribute api_version to.



8
9
10
# File 'lib/metropol.rb', line 8

def api_version=(value)
  @api_version = value
end

.port=(value) ⇒ Object (writeonly)

Sets the attribute port

Parameters:

  • value

    the value to set the attribute port to.



8
9
10
# File 'lib/metropol.rb', line 8

def port=(value)
  @port = value
end

.private_key=(value) ⇒ Object (writeonly)

Sets the attribute private_key

Parameters:

  • value

    the value to set the attribute private_key to.



8
9
10
# File 'lib/metropol.rb', line 8

def private_key=(value)
  @private_key = value
end

.public_key=(value) ⇒ Object (writeonly)

Sets the attribute public_key

Parameters:

  • value

    the value to set the attribute public_key to.



8
9
10
# File 'lib/metropol.rb', line 8

def public_key=(value)
  @public_key = value
end

Class Method Details

.clientObject



10
11
12
13
14
15
# File 'lib/metropol.rb', line 10

def client
  @client ||= Metropol::Client.new(public_key: @public_key,
                                   private_key: @private_key,
                                   port: @port,
                                   api_version: @api_version)
end

.configure {|_self| ... } ⇒ Object

Set configuration variables using a block

Yields:

  • (_self)

Yield Parameters:

  • _self (Metropol)

    the object that the method was called on



18
19
20
# File 'lib/metropol.rb', line 18

def configure
  yield self
end

.method_missing(method_name, *args, &block) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/metropol.rb', line 22

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

  super
end

.reset!Object



30
31
32
33
34
35
# File 'lib/metropol.rb', line 30

def reset!
  @public_key = nil
  @private_key = nil
  @port = nil
  @api_version = nil
end