Sha256: 9d3a00c56415f0dca61813909875e4363dc61eef86c7a025bb6945b2d9b454df

Contents?: true

Size: 354 Bytes

Versions: 7

Compression:

Stored size: 354 Bytes

Contents

module Healthety
  class Worker
    attr_reader :name

    def initialize(name, &block)
      @name = name.to_s
      @block = block
    end

    def interval(interval = nil)
      @interval = interval || @interval
    end

    def value(value = nil)
      @value = value || @value
    end

    def perform
      instance_eval(&@block)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
healthety-0.0.7 lib/healthety/worker.rb
healthety-0.0.6 lib/healthety/worker.rb
healthety-0.0.5 lib/healthety/worker.rb
healthety-0.0.4 lib/healthety/worker.rb
healthety-0.0.3 lib/healthety/worker.rb
healthety-0.0.2 lib/healthety/worker.rb
healthety-0.0.1 lib/healthety/worker.rb