Class: Linodians::Group

Inherits:
Delegator
  • Object
show all
Defined in:
lib/linodians/group.rb

Overview

Group of employees

Instance Attribute Summary collapse

Instance Method Summary collapse

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

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