Class: QuickappsFeedback::Feedback

Inherits:
Object
  • Object
show all
Defined in:
lib/quickapps_feedback/feedback.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uid, full_message, support_type) ⇒ Feedback

Returns a new instance of Feedback.



7
8
9
10
11
12
# File 'lib/quickapps_feedback/feedback.rb', line 7

def initialize(uid,full_message,support_type)
  @uid = uid
  @subject, @message = full_message.split(':',2)
  @message ||= @subject
  @support_type = support_type
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



5
6
7
# File 'lib/quickapps_feedback/feedback.rb', line 5

def message
  @message
end

#subjectObject (readonly)

Returns the value of attribute subject.



5
6
7
# File 'lib/quickapps_feedback/feedback.rb', line 5

def subject
  @subject
end

#support_typeObject (readonly)

Returns the value of attribute support_type.



5
6
7
# File 'lib/quickapps_feedback/feedback.rb', line 5

def support_type
  @support_type
end

#uidObject (readonly)

Returns the value of attribute uid.



5
6
7
# File 'lib/quickapps_feedback/feedback.rb', line 5

def uid
  @uid
end

Instance Method Details

#user_accountObject



14
15
16
17
18
19
20
21
22
23
# File 'lib/quickapps_feedback/feedback.rb', line 14

def 
  return  if 
  connection = Excon.new(ENV['USER_ACCOUNT_API'])
  result = connection.get(path: '/api/user_accounts',
                          headers: {'X-API-Token' => ENV['USER_ACCOUNT_API_KEY'] },
                          query: {uid: uid,
                                  provider: 'mxit'},
                          :expects => 200)
   = JSON.parse(result.body).first
end

#user_emailObject



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

def user_email
  ['email']
end

#user_real_nameObject



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

def user_real_name
  ['real_name']
end