Class: Roster::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/roster/base.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ Base

Returns a new instance of Base.



15
16
17
# File 'lib/roster/base.rb', line 15

def initialize(token)
  @token = token
end

Class Method Details

.get_login_urlObject



5
6
7
8
9
10
11
12
13
# File 'lib/roster/base.rb', line 5

def self.
  url = URI.parse(Configuration.instance.endpoint)
  res = Net::HTTP.start(url.host, url.port) do |http|
    http.get('/')
  end

  raise if res.code != "302"
  res['location']
end

Instance Method Details

#myselfObject



19
20
21
# File 'lib/roster/base.rb', line 19

def myself
  request '/myself'
end