Class: DssReuters::User

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/dss_reuters.rb

Instance Method Summary collapse

Constructor Details

#initialize(session) ⇒ User

Returns a new instance of User.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/dss_reuters.rb', line 59

def initialize(session)
  @session = session
  path = "/RestApi/v1/Users/Users(#{Config::DSS_USERNAME})"
  options = {
    headers: {
      "Prefer" => "respond-async",
      "Authorization" => "Token #{@session.token}"
    }
  }
  if session.configured?
    resp = self.class.get path, options
    @session.logger.debug resp
  else
    session.not_configured_error
  end
end