Module: PickpointApi

Defined in:
lib/pickpoint_api.rb

Defined Under Namespace

Modules: Constants, Exceptions Classes: Session

Class Method Summary collapse

Class Method Details

.session(login, password, hash = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/pickpoint_api.rb', line 3

def self.session , password, hash = {}
  begin
    session = Session.new hash
    session. , password
    yield session
  rescue => ex
    raise ::PickpointApi::Exceptions::ApiError, ex.message
  ensure
    if !session.nil? && session.state != :closed
      session.logout
    end
  end
end