Class: Mooset::Endpoints::Ldap::Group

Inherits:
Models::Group show all
Defined in:
lib/mooset/endpoints/ldap/group.rb

Direct Known Subclasses

Ou

Instance Attribute Summary

Attributes inherited from Model

#endpoint

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Models::Group

#to_s

Methods inherited from Model

finders, #finders, #initialize, #to_json, #to_s

Constructor Details

This class inherits a constructor from Mooset::Model

Class Method Details

.build(endpoint, params) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/mooset/endpoints/ldap/group.rb', line 9

def self.build(endpoint, params)
  group = Optional.new(params)
  new(
    endpoint: endpoint,
    id: group[:dn].first.value,
    dn: group[:dn].first.value,
    name: group[:cn].first.value
  )
end

Instance Method Details

#membersObject



19
20
21
# File 'lib/mooset/endpoints/ldap/group.rb', line 19

def members
  endpoint.users.find(memberof: id)
end