Module: Teamlab

Defined in:
lib/teamlab.rb,
lib/teamlab/config.rb,
lib/teamlab/request.rb,
lib/teamlab/version.rb,
lib/teamlab/response.rb,
lib/teamlab/modules/crm.rb,
lib/teamlab/modules/mail.rb,
lib/teamlab/modules/files.rb,
lib/teamlab/modules/group.rb,
lib/teamlab/modules/people.rb,
lib/teamlab/modules/portals.rb,
lib/teamlab/modules/project.rb,
lib/teamlab/modules/calendar.rb,
lib/teamlab/modules/settings.rb,
lib/teamlab/modules/community.rb

Defined Under Namespace

Classes: Calendar, Community, Config, Crm, Files, Group, Mail, People, Portal, Project, Request, Response, Settings

Constant Summary collapse

VERSION =
'0.6'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



6
7
8
# File 'lib/teamlab/config.rb', line 6

def config
  @config
end

Class Method Details

.calendarObject



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

def self.calendar
  @calendar ||= Teamlab::Calendar.new
end

.communityObject



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

def self.community
  @community ||= Teamlab::Community.new
end

.configObject



18
19
20
# File 'lib/teamlab/config.rb', line 18

def self.config
  @config ||= Config.new
end

.configure {|@config| ... } ⇒ Object

Yields:



8
9
10
11
12
13
14
15
16
# File 'lib/teamlab/config.rb', line 8

def self.configure(&_block)
  warn '[DEPRECATION] This gem has been renamed to `onlyoffice_api` and will no longer be supported. Please switch to `onlyoffice_api` gem as soon as possible.'
  @config ||= Config.new
  yield @config if block_given?
  auth_response = Teamlab::Request.new('authentication').post('', userName: @config.username, password: @config.password).body
  fail "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

.crmObject



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

def self.crm
  @crm ||= Teamlab::Crm.new
end

.filesObject



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

def self.files
  @files ||= Teamlab::Files.new
end

.groupObject



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

def self.group
  @group ||= Teamlab::Group.new
end

.mailObject



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

def self.mail
  @mail ||= Teamlab::Mail.new
end

.peopleObject



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

def self.people
  @people ||= Teamlab::People.new
end

.portalObject



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

def self.portal
  @portal ||= Teamlab::Portal.new
end

.projectObject



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

def self.project
  @project ||= Teamlab::Project.new
end

.settingsObject



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

def self.settings
  @settings ||= Teamlab::Settings.new
end