Module: Teamlab

Defined in:
lib/teamlab/name.rb,
lib/onlyoffice_api.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/feed.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,
lib/teamlab/modules/mailserver.rb,
lib/teamlab/modules/crm/crm_tags.rb,
lib/teamlab/modules/crm/crm_cases.rb,
lib/teamlab/modules/crm/crm_files.rb,
lib/teamlab/modules/crm/crm_tasks.rb,
lib/teamlab/modules/crm/crm_common.rb,
lib/teamlab/modules/mail/mail_tags.rb,
lib/teamlab/modules/crm/crm_history.rb,
lib/teamlab/modules/crm/crm_contacts.rb,
lib/teamlab/modules/crm/crm_invoices.rb,
lib/teamlab/modules/mail/mail_alerts.rb,
lib/teamlab/modules/mail/mail_images.rb,
lib/teamlab/modules/mail/mail_folders.rb,
lib/teamlab/modules/group/group_helper.rb,
lib/teamlab/modules/mail/mail_accounts.rb,
lib/teamlab/modules/mail/mail_contacts.rb,
lib/teamlab/modules/mail/mail_messages.rb,
lib/teamlab/modules/mail/mail_settings.rb,
lib/teamlab/modules/mailserver/domains.rb,
lib/teamlab/responce/custom_exceptions.rb,
lib/teamlab/modules/crm/crm_user_fields.rb,
lib/teamlab/modules/mail/mail_signature.rb,
lib/teamlab/modules/crm/crm_organisation.rb,
lib/teamlab/modules/mail/mail_helpcenter.rb,
lib/teamlab/modules/mailserver/mailboxes.rb,
lib/teamlab/modules/people/people_remove.rb,
lib/teamlab/modules/crm/crm_opportunities.rb,
lib/onlyoffice_api/onlyoffice_api_instance.rb,
lib/teamlab/modules/people/people_reassign.rb,
lib/teamlab/modules/projects/projects_tags.rb,
lib/teamlab/modules/projects/projects_team.rb,
lib/teamlab/modules/projects/projects_time.rb,
lib/teamlab/modules/mail/mail_conversations.rb,
lib/teamlab/modules/projects/projects_files.rb,
lib/teamlab/modules/projects/projects_tasks.rb,
lib/teamlab/modules/community/community_wiki.rb,
lib/teamlab/modules/community/community_blogs.rb,
lib/teamlab/modules/projects/projects_reports.rb,
lib/teamlab/modules/community/community_events.rb,
lib/teamlab/modules/community/community_forums.rb,
lib/teamlab/modules/projects/projects_comments.rb,
lib/teamlab/modules/projects/projects_contacts.rb,
lib/teamlab/modules/projects/projects_projects.rb,
lib/teamlab/modules/projects/projects_settings.rb,
lib/teamlab/modules/projects/projects_templates.rb,
lib/teamlab/modules/projects/projects_milestones.rb,
lib/teamlab/modules/community/community_bookmarks.rb,
lib/teamlab/modules/projects/projects_discussions.rb

Defined Under Namespace

Modules: CommunityBlogs, CommunityBookmarks, CommunityEvents, CommunityForums, CommunityWiki, CrmCases, CrmCommon, CrmContacts, CrmFiles, CrmHistory, CrmInvoices, CrmOpportunities, CrmOrganisation, CrmTags, CrmTasks, CrmUserFields, GroupHelper, MailAccounts, MailAlerts, MailContacts, MailConversations, MailFolders, MailHelpCenter, MailImages, MailMessages, MailSettings, MailSignature, MailTags, MailserverDomains, MailserverMailboxes, PeopleReassign, PeopleRemove, ProjectsComments, ProjectsContacts, ProjectsDiscussions, ProjectsFiles, ProjectsMilestones, ProjectsProjects, ProjectsReports, ProjectsSettings, ProjectsTags, ProjectsTasks, ProjectsTeam, ProjectsTemplates, ProjectsTime Classes: Calendar, Community, Config, Crm, Feed, Files, Group, Mail, MailServer, NoJsonInResponce, OnlyofficeApiInstance, People, Portal, Project, Request, Response, Settings

Constant Summary collapse

NAME =
'onlyoffice_api'
VERSION =
'1.0.1'

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



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

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

.communityObject



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

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)
  @config ||= Config.new
  yield @config if block
  auth_response = Teamlab::Request.new(nil, '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

.crmObject



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

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

.feedObject



66
67
68
# File 'lib/onlyoffice_api.rb', line 66

def self.feed
  @feed ||= Teamlab::Feed.new
end

.filesObject



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

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

.groupObject



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

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

.mailObject



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

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

.mailserverObject



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

def self.mailserver
  @mailserver ||= Teamlab::MailServer.new
end

.peopleObject



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

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

.portalObject



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

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

.projectObject



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

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

.settingsObject



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

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