Class: Makesure::Summarize

Inherits:
Object
  • Object
show all
Defined in:
lib/makesure/summarize.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, cron, blk) ⇒ Summarize

Returns a new instance of Summarize.



7
8
9
10
11
# File 'lib/makesure/summarize.rb', line 7

def initialize(name, cron, blk)
  @name = name
  @cron = cron
  @blk  = blk
end

Instance Attribute Details

#blkObject (readonly)

Returns the value of attribute blk.



5
6
7
# File 'lib/makesure/summarize.rb', line 5

def blk
  @blk
end

#cronObject (readonly)

Returns the value of attribute cron.



5
6
7
# File 'lib/makesure/summarize.rb', line 5

def cron
  @cron
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/makesure/summarize.rb', line 5

def name
  @name
end

Instance Method Details

#run!Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/makesure/summarize.rb', line 13

def run!
  begin
    
    blk.call
    
  rescue Exception => e
    Makesure.warn "Uh oh, something's up"
    Makesure.warn "\t" + e.message
    
    # send an email with the details
    
    return false
  end
  
  true
end