Class: QuickappsFeedback::Feedback
- Inherits:
-
Object
- Object
- QuickappsFeedback::Feedback
- Defined in:
- lib/quickapps_feedback/feedback.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
-
#support_type ⇒ Object
readonly
Returns the value of attribute support_type.
-
#uid ⇒ Object
readonly
Returns the value of attribute uid.
Instance Method Summary collapse
-
#initialize(uid, full_message, support_type) ⇒ Feedback
constructor
A new instance of Feedback.
- #user_account ⇒ Object
- #user_email ⇒ Object
- #user_real_name ⇒ Object
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,,support_type) @uid = uid @subject, = .split(':',2) ||= @subject @support_type = support_type end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/quickapps_feedback/feedback.rb', line 5 def end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
5 6 7 |
# File 'lib/quickapps_feedback/feedback.rb', line 5 def subject @subject end |
#support_type ⇒ Object (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 |
#uid ⇒ Object (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_account ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/quickapps_feedback/feedback.rb', line 14 def user_account return @user_account if @user_account 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) @user_account = JSON.parse(result.body).first end |
#user_email ⇒ Object
25 26 27 |
# File 'lib/quickapps_feedback/feedback.rb', line 25 def user_email user_account['email'] end |
#user_real_name ⇒ Object
29 30 31 |
# File 'lib/quickapps_feedback/feedback.rb', line 29 def user_real_name user_account['real_name'] end |