Class: ARBACVerifier::UserRole

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/arbac_verifier/classes/user_role.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#roleObject (readonly)

Returns the value of attribute role.



13
14
15
# File 'lib/arbac_verifier/classes/user_role.rb', line 13

def role
  @role
end

#userObject (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

Returns:

  • (Boolean)


26
27
28
# File 'lib/arbac_verifier/classes/user_role.rb', line 26

def eql?(other)
  self == other
end

#hashObject



30
31
32
# File 'lib/arbac_verifier/classes/user_role.rb', line 30

def hash
  [user, role].hash
end