Class: IAuditor::Base

Inherits:
Object
  • Object
show all
Includes:
BaseModules::Methods
Defined in:
lib/iAuditor/base.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BaseModules::Methods

included, #initialize

Class Method Details

.token(username, password, grant_type) ⇒ Object



23
24
25
26
27
28
29
30
31
32
# File 'lib/iAuditor/base.rb', line 23

def self.token(username, password, grant_type)
  token = HTTParty.post('https://api.safetyculture.io/auth',
  :body => {
              "username": username,
              "password": password,
              "grant_type":"password"
           }
  ).parsed_response["access_token"]
  token
end

Instance Method Details

#actionsObject



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

def actions
  IAuditor::Actions.new(@options)
end

#auditsObject



7
8
9
# File 'lib/iAuditor/base.rb', line 7

def audits
  IAuditor::Audit.new(@options)
end

#exportObject



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

def export
  IAuditor::Export.new(@options)
end

#templatesObject



11
12
13
# File 'lib/iAuditor/base.rb', line 11

def templates
  IAuditor::Template.new(@options)
end