Class: Teamlab::OnlyofficeApiInstance

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyoffice_api/onlyoffice_api_instance.rb

Overview

Class for multiuser instance

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ OnlyofficeApiInstance

Returns a new instance of OnlyofficeApiInstance.



8
9
10
11
12
13
14
15
# File 'lib/onlyoffice_api/onlyoffice_api_instance.rb', line 8

def initialize(params = {})
  @config = Config.new(params)
  auth_response = Teamlab::Request.new(@config, 'authentication').post('', userName: @config.username, password: @config.password).body
  raise "Cannot get response token for #{auth_response}" if auth_response['response'].nil? || auth_response['response']['token'].nil?

  @config.token = auth_response['response']['token']
  @config.headers = { 'authorization' => @config.token }
end

Instance Method Details

#calendarObject



49
50
51
# File 'lib/onlyoffice_api/onlyoffice_api_instance.rb', line 49

def calendar
  @calendar ||= Teamlab::Calendar.new(@config)
end

#communityObject



45
46
47
# File 'lib/onlyoffice_api/onlyoffice_api_instance.rb', line 45

def community
  @community ||= Teamlab::Community.new(@config)
end

#crmObject



41
42
43
# File 'lib/onlyoffice_api/onlyoffice_api_instance.rb', line 41

def crm
  @crm ||= Teamlab::Crm.new(@config)
end

#feedObject



61
62
63
# File 'lib/onlyoffice_api/onlyoffice_api_instance.rb', line 61

def feed
  @feed ||= Teamlab::Feed.new(@config)
end

#filesObject



29
30
31
# File 'lib/onlyoffice_api/onlyoffice_api_instance.rb', line 29

def files
  @files ||= Teamlab::Files.new(@config)
end

#groupObject



21
22
23
# File 'lib/onlyoffice_api/onlyoffice_api_instance.rb', line 21

def group
  @group ||= Teamlab::Group.new(@config)
end

#mailObject



53
54
55
# File 'lib/onlyoffice_api/onlyoffice_api_instance.rb', line 53

def mail
  @mail ||= Teamlab::Mail.new(@config)
end

#mailserverObject



57
58
59
# File 'lib/onlyoffice_api/onlyoffice_api_instance.rb', line 57

def mailserver
  @mailserver ||= Teamlab::MailServer.new(@config)
end

#peopleObject



17
18
19
# File 'lib/onlyoffice_api/onlyoffice_api_instance.rb', line 17

def people
  @people ||= Teamlab::People.new(@config)
end

#portalObject



37
38
39
# File 'lib/onlyoffice_api/onlyoffice_api_instance.rb', line 37

def portal
  @portal ||= Teamlab::Portal.new(@config)
end

#projectObject



33
34
35
# File 'lib/onlyoffice_api/onlyoffice_api_instance.rb', line 33

def project
  @project ||= Teamlab::Project.new(@config)
end

#settingsObject



25
26
27
# File 'lib/onlyoffice_api/onlyoffice_api_instance.rb', line 25

def settings
  @settings ||= Teamlab::Settings.new(@config)
end