Class: GmailSignaturePusher::BatchResult

Inherits:
Data
  • Object
show all
Defined in:
app/services/gmail_signature_pusher.rb

Overview

Service object: batch result.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(results: [], pushed_at: Time.current) ⇒ BatchResult

Returns a new instance of BatchResult.



17
18
19
# File 'app/services/gmail_signature_pusher.rb', line 17

def initialize(results: [], pushed_at: Time.current)
  super
end

Instance Attribute Details

#pushed_atObject (readonly)

Returns the value of attribute pushed_at

Returns:

  • (Object)

    the current value of pushed_at



16
17
18
# File 'app/services/gmail_signature_pusher.rb', line 16

def pushed_at
  @pushed_at
end

#resultsObject (readonly)

Returns the value of attribute results

Returns:

  • (Object)

    the current value of results



16
17
18
# File 'app/services/gmail_signature_pusher.rb', line 16

def results
  @results
end

Instance Method Details

#failedObject



22
# File 'app/services/gmail_signature_pusher.rb', line 22

def failed    = results.reject(&:success)

#succeededObject



21
# File 'app/services/gmail_signature_pusher.rb', line 21

def succeeded = results.select(&:success)

#totalObject



23
# File 'app/services/gmail_signature_pusher.rb', line 23

def total     = results.size