Class: SynchronizeUsers::TargetGroup::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/synchronize-users/target_group.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, object = nil) ⇒ Result

Returns a new instance of Result.



8
9
10
11
# File 'lib/synchronize-users/target_group.rb', line 8

def initialize(status, object = nil)
  @status = status
  @object = object
end

Class Method Details

.error(e) ⇒ Object



6
# File 'lib/synchronize-users/target_group.rb', line 6

def self.error(e) new(:error, e) end

.new_user(source) ⇒ Object



5
# File 'lib/synchronize-users/target_group.rb', line 5

def self.new_user(source) new(:new_user, source) end

Instance Method Details

#on_error {|@object| ... } ⇒ Object

Yields:

  • (@object)


17
18
19
# File 'lib/synchronize-users/target_group.rb', line 17

def on_error
  yield(@object) if @status == :error
end

#on_new_user {|@object| ... } ⇒ Object

Yields:

  • (@object)


13
14
15
# File 'lib/synchronize-users/target_group.rb', line 13

def on_new_user
  yield(@object) if @status == :new_user
end