Class: PMP::Client

Inherits:
Object
  • Object
show all
Includes:
Configuration
Defined in:
lib/pmp/client.rb

Constant Summary

Constants included from Configuration

PMP::Configuration::DEFAULT_ADAPTER, PMP::Configuration::DEFAULT_CLIENT_ID, PMP::Configuration::DEFAULT_CLIENT_SECRET, PMP::Configuration::DEFAULT_ENDPOINT, PMP::Configuration::DEFAULT_USER_AGENT, PMP::Configuration::VALID_OPTIONS_KEYS

Instance Method Summary collapse

Methods included from Configuration

#apply_configuration, #configure, #options, #reset!

Constructor Details

#initialize(options = {}) {|_self| ... } ⇒ Client

Returns a new instance of Client.

Yields:

  • (_self)

Yield Parameters:

  • _self (PMP::Client)

    the object that the method was called on



8
9
10
11
# File 'lib/pmp/client.rb', line 8

def initialize(options={}, &block)
  apply_configuration(options)
  yield(self) if block_given?
end

Instance Method Details

#root(opts = {}, &block) ⇒ Object



17
18
19
# File 'lib/pmp/client.rb', line 17

def root(opts={}, &block)      
  PMP::CollectionDocument.new(options.merge(opts), &block)
end

#token(opts = {}) ⇒ Object



13
14
15
# File 'lib/pmp/client.rb', line 13

def token(opts={})
  PMP::Token.new(options.merge(opts)).get_token
end