Class: Linodians::Group
- Inherits:
-
Delegator
- Object
- Delegator
- Linodians::Group
- Defined in:
- lib/linodians/group.rb
Overview
Group of employees
Instance Attribute Summary collapse
-
#members ⇒ Object
(also: #__getobj__)
readonly
Returns the value of attribute members.
Instance Method Summary collapse
- #__setobj__(_) ⇒ Object
-
#initialize(data = nil) ⇒ Group
constructor
A new instance of Group.
- #lookup(username) ⇒ Object
Constructor Details
#initialize(data = nil) ⇒ Group
Returns a new instance of Group.
10 11 12 13 14 |
# File 'lib/linodians/group.rb', line 10 def initialize(data = nil) @members = Linodians.load_data(data) @members.freeze super(@members) end |
Instance Attribute Details
#members ⇒ Object (readonly) Also known as: __getobj__
Returns the value of attribute members.
7 8 9 |
# File 'lib/linodians/group.rb', line 7 def members @members end |
Instance Method Details
#__setobj__(_) ⇒ Object
20 21 22 |
# File 'lib/linodians/group.rb', line 20 def __setobj__(_) @members end |
#lookup(username) ⇒ Object
16 17 18 |
# File 'lib/linodians/group.rb', line 16 def lookup(username) find { |x| x.username == username } end |