Class: UserRoleObject
- Inherits:
-
Object
- Object
- UserRoleObject
- Includes:
- DataFactory, Foundry, StringFactory
- Defined in:
- lib/kuality-coeus/data_objects/user/user_role.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#qualifiers ⇒ Object
Returns the value of attribute qualifiers.
-
#type ⇒ Object
Returns the value of attribute type.
-
#user_name ⇒ Object
Returns the value of attribute user_name.
Instance Method Summary collapse
-
#create ⇒ Object
All navigation is done in the parent, UserObject.
-
#initialize(browser, opts = {}) ⇒ UserRoleObject
constructor
A new instance of UserRoleObject.
Constructor Details
#initialize(browser, opts = {}) ⇒ UserRoleObject
Returns a new instance of UserRoleObject.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/kuality-coeus/data_objects/user/user_role.rb', line 10 def initialize(browser, opts={}) @browser = browser defaults = { id: '106', name: 'unassigned', qualifiers: [{:unit=>'000001'}] } defaults.merge(opts) requires :user_name end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/kuality-coeus/data_objects/user/user_role.rb', line 7 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/kuality-coeus/data_objects/user/user_role.rb', line 7 def name @name end |
#namespace ⇒ Object
Returns the value of attribute namespace.
7 8 9 |
# File 'lib/kuality-coeus/data_objects/user/user_role.rb', line 7 def namespace @namespace end |
#qualifiers ⇒ Object
Returns the value of attribute qualifiers.
7 8 9 |
# File 'lib/kuality-coeus/data_objects/user/user_role.rb', line 7 def qualifiers @qualifiers end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/kuality-coeus/data_objects/user/user_role.rb', line 7 def type @type end |
#user_name ⇒ Object
Returns the value of attribute user_name.
7 8 9 |
# File 'lib/kuality-coeus/data_objects/user/user_role.rb', line 7 def user_name @user_name end |
Instance Method Details
#create ⇒ Object
All navigation is done in the parent, UserObject. IMPORTANT: This includes saving the changes!
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/kuality-coeus/data_objects/user/user_role.rb', line 24 def create on Person do |create| create.description.set random_alphanums create.role_id.set @id create.add_role @qualifiers.each do |unit| create.unit_number(@id).set unit[:unit] create.descends_hierarchy(@id).fit unit[:descends_hierarchy] create.add_role_qualifier(@id) end end end |