Class: CanvasFactory::UserConfig
- Inherits:
-
Object
- Object
- CanvasFactory::UserConfig
- Defined in:
- lib/japanda/canvas_factory/user_config.rb
Instance Attribute Summary collapse
-
#email_id ⇒ Object
Returns the value of attribute email_id.
-
#email_prefix ⇒ Object
Returns the value of attribute email_prefix.
-
#force_validations ⇒ Object
Returns the value of attribute force_validations.
-
#password ⇒ Object
Returns the value of attribute password.
-
#role_id ⇒ Object
Returns the value of attribute role_id.
-
#send_confirmation ⇒ Object
Returns the value of attribute send_confirmation.
-
#short_name ⇒ Object
Returns the value of attribute short_name.
-
#terms_of_use ⇒ Object
Returns the value of attribute terms_of_use.
Instance Method Summary collapse
- #admin_request_body(id) ⇒ Object
-
#initialize(opts = {}) ⇒ UserConfig
constructor
A new instance of UserConfig.
- #user_request_body ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ UserConfig
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/japanda/canvas_factory/user_config.rb', line 6 def initialize(opts = {}) @email_prefix = opts[:email_prefix] || 'catauto' @password = opts[:password] || 'Testing01' @short_name = opts[:short_name] || 'cat auto' @terms_of_use = opts[:terms_of_use] || '1' @send_confirmation = opts[:send_confirmation] || true @force_validations = opts[:force_validations] || true @role_id = opts[:role_id] || 'AccountAdmin' @email_id = opts[:email_id] || "#{@email_prefix}#{SecureRandom.hex}@example.com" end |
Instance Attribute Details
#email_id ⇒ Object
Returns the value of attribute email_id.
3 4 5 |
# File 'lib/japanda/canvas_factory/user_config.rb', line 3 def email_id @email_id end |
#email_prefix ⇒ Object
Returns the value of attribute email_prefix.
3 4 5 |
# File 'lib/japanda/canvas_factory/user_config.rb', line 3 def email_prefix @email_prefix end |
#force_validations ⇒ Object
Returns the value of attribute force_validations.
3 4 5 |
# File 'lib/japanda/canvas_factory/user_config.rb', line 3 def force_validations @force_validations end |
#password ⇒ Object
Returns the value of attribute password.
3 4 5 |
# File 'lib/japanda/canvas_factory/user_config.rb', line 3 def password @password end |
#role_id ⇒ Object
Returns the value of attribute role_id.
3 4 5 |
# File 'lib/japanda/canvas_factory/user_config.rb', line 3 def role_id @role_id end |
#send_confirmation ⇒ Object
Returns the value of attribute send_confirmation.
3 4 5 |
# File 'lib/japanda/canvas_factory/user_config.rb', line 3 def send_confirmation @send_confirmation end |
#short_name ⇒ Object
Returns the value of attribute short_name.
3 4 5 |
# File 'lib/japanda/canvas_factory/user_config.rb', line 3 def short_name @short_name end |
#terms_of_use ⇒ Object
Returns the value of attribute terms_of_use.
3 4 5 |
# File 'lib/japanda/canvas_factory/user_config.rb', line 3 def terms_of_use @terms_of_use end |
Instance Method Details
#admin_request_body(id) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/japanda/canvas_factory/user_config.rb', line 33 def admin_request_body(id) { user_id: id, role_id: @role_id, send_confirmation: @send_confirmation } end |
#user_request_body ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/japanda/canvas_factory/user_config.rb', line 17 def user_request_body { user: { name: @email_id, short_name: @short_name, terms_of_use: @terms_of_use, send_confirmation: @send_confirmation }, pseudonym: { unique_id: @email_id, password: @password }, force_validations: @force_validations } end |