Class: UserQuery

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
app/models/user_query.rb

Overview

Handles input from the 'Help' button and used to generate an email.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UserQuery

Returns a new instance of UserQuery.


10
11
12
13
# File 'app/models/user_query.rb', line 10

def initialize(attributes = {})
  super
  @user_email = update_user_email
end

Instance Attribute Details

#urlObject

Returns the value of attribute url.


6
7
8
# File 'app/models/user_query.rb', line 6

def url
  @url
end

#userObject

Returns the value of attribute user.


6
7
8
# File 'app/models/user_query.rb', line 6

def user
  @user
end

#user_emailObject

Returns the value of attribute user_email.


6
7
8
# File 'app/models/user_query.rb', line 6

def user_email
  @user_email
end

#what_expectedObject

Returns the value of attribute what_expected.


6
7
8
# File 'app/models/user_query.rb', line 6

def what_expected
  @what_expected
end

#what_happenedObject

Returns the value of attribute what_happened.


6
7
8
# File 'app/models/user_query.rb', line 6

def what_happened
  @what_happened
end

#what_was_trying_to_doObject

Returns the value of attribute what_was_trying_to_do.


6
7
8
# File 'app/models/user_query.rb', line 6

def what_was_trying_to_do
  @what_was_trying_to_do
end

Instance Method Details

#dateObject


23
24
25
# File 'app/models/user_query.rb', line 23

def date
  Time.zone.now.to_formatted_s(:long_ordinal)
end

#fromObject


15
16
17
# File 'app/models/user_query.rb', line 15

def from
  user_email
end

#toObject


19
20
21
# File 'app/models/user_query.rb', line 19

def to
  configatron.admin_email
end

#update_user_emailObject


27
28
29
# File 'app/models/user_query.rb', line 27

def update_user_email
  @user_email ||= (user.email if user.present?)
end