Sha256: a8f7e68a52005232f5d5583bd86008b6f82662f9698f5e51d924c6b9fe9dc632

Contents?: true

Size: 508 Bytes

Versions: 2

Compression:

Stored size: 508 Bytes

Contents

require 'open-uri'

# Sample pseudo participant
#
# See http://gist.github.com/144861 for a test engine
class Sample < DaemonKit::RuotePseudoParticipant

  on_exception :dammit

  on_complete do |workitem|
    workitem['success'] = true
  end

  def quote
    workitem["quote"] = open("http://www.iheartquotes.com/api/v1/random").read
  end

  def err
    raise ArgumentError, "Does not compute"
  end

  def dammit( exception )
    workitem["error"] = exception.message
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bunnicula-0.2.2 vendor/daemon-kit/daemon_generators/ruote/templates/lib/sample.rb
bunnicula-0.2.1 vendor/daemon_kit/daemon-kit/daemon_generators/ruote/templates/lib/sample.rb