Class: SynchronizeUsers::FromGroup
- Inherits:
-
Object
- Object
- SynchronizeUsers::FromGroup
- Defined in:
- lib/synchronize-users/from_group.rb
Instance Method Summary collapse
- #each_new_user ⇒ Object
-
#initialize(connection, query, target_group) ⇒ FromGroup
constructor
A new instance of FromGroup.
Constructor Details
#initialize(connection, query, target_group) ⇒ FromGroup
Returns a new instance of FromGroup.
3 4 5 6 7 |
# File 'lib/synchronize-users/from_group.rb', line 3 def initialize(connection, query, target_group) @connection = connection @query = query @target_group = target_group end |
Instance Method Details
#each_new_user ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/synchronize-users/from_group.rb', line 9 def each_new_user @connection.find(@query).each do |group| group.members.each do |member| yield member unless @target_group.has_user?(member) end end end |