Class: ARBACVerifier::UserRole
- Inherits:
-
Object
- Object
- ARBACVerifier::UserRole
- Extended by:
- T::Sig
- Defined in:
- lib/arbac_verifier/classes/user_role.rb
Instance Attribute Summary collapse
-
#role ⇒ Object
readonly
Returns the value of attribute role.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#==(other) ⇒ Object
overrides.
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(user, role) ⇒ UserRole
constructor
A new instance of UserRole.
Constructor Details
#initialize(user, role) ⇒ UserRole
Returns a new instance of UserRole.
16 17 18 19 |
# File 'lib/arbac_verifier/classes/user_role.rb', line 16 def initialize(user, role) @user = user @role = role end |
Instance Attribute Details
#role ⇒ Object (readonly)
Returns the value of attribute role.
13 14 15 |
# File 'lib/arbac_verifier/classes/user_role.rb', line 13 def role @role end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
10 11 12 |
# File 'lib/arbac_verifier/classes/user_role.rb', line 10 def user @user end |
Instance Method Details
#==(other) ⇒ Object
overrides
22 23 24 |
# File 'lib/arbac_verifier/classes/user_role.rb', line 22 def ==(other) other.is_a?(UserRole) && self.user == other.user && self.role == other.role end |
#eql?(other) ⇒ Boolean
26 27 28 |
# File 'lib/arbac_verifier/classes/user_role.rb', line 26 def eql?(other) self == other end |
#hash ⇒ Object
30 31 32 |
# File 'lib/arbac_verifier/classes/user_role.rb', line 30 def hash [user, role].hash end |