Class: Vanagon::Common::User
- Inherits:
-
Object
- Object
- Vanagon::Common::User
- Defined in:
- lib/vanagon/common/user.rb
Instance Attribute Summary collapse
-
#group ⇒ Object
Returns the value of attribute group.
-
#homedir ⇒ Object
Returns the value of attribute homedir.
-
#is_system ⇒ Object
Returns the value of attribute is_system.
-
#name ⇒ Object
Returns the value of attribute name.
-
#shell ⇒ Object
Returns the value of attribute shell.
Instance Method Summary collapse
-
#==(other) ⇒ true, false
Equality.
-
#initialize(name, group = nil, shell = nil, is_system = false, homedir = nil) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(name, group = nil, shell = nil, is_system = false, homedir = nil) ⇒ User
Returns a new instance of User.
6 7 8 9 10 11 12 |
# File 'lib/vanagon/common/user.rb', line 6 def initialize(name, group = nil, shell = nil, is_system = false, homedir = nil) @name = name @group = group ? group : @name @shell = shell if shell @is_system = is_system if is_system @homedir = homedir if homedir end |
Instance Attribute Details
#group ⇒ Object
Returns the value of attribute group.
4 5 6 |
# File 'lib/vanagon/common/user.rb', line 4 def group @group end |
#homedir ⇒ Object
Returns the value of attribute homedir.
4 5 6 |
# File 'lib/vanagon/common/user.rb', line 4 def homedir @homedir end |
#is_system ⇒ Object
Returns the value of attribute is_system.
4 5 6 |
# File 'lib/vanagon/common/user.rb', line 4 def is_system @is_system end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/vanagon/common/user.rb', line 4 def name @name end |
#shell ⇒ Object
Returns the value of attribute shell.
4 5 6 |
# File 'lib/vanagon/common/user.rb', line 4 def shell @shell end |
Instance Method Details
#==(other) ⇒ true, false
Equality. How does it even work?
17 18 19 20 21 22 23 |
# File 'lib/vanagon/common/user.rb', line 17 def ==(other) other.name == self.name && \ other.group == self.group && \ other.shell == self.shell && \ other.is_system == self.is_system && \ other.homedir == self.homedir end |