Class: Sample
- Inherits:
- DaemonKit::RuotePseudoParticipant show all
- Includes:
- Nanite::Actor
- Defined in:
- lib/generators/daemon_kit/ruote/templates/lib/sample.rb,
lib/generators/daemon_kit/nanite_agent/templates/lib/actors/sample.rb
Overview
Sample pseudo participant
See gist.github.com/144861 for a test engine
Instance Attribute Summary
Attributes inherited from DaemonKit::RuotePseudoParticipant
Instance Method Summary collapse
- #dammit(exception) ⇒ Object
-
#echo(payload) ⇒ Object
Print to STDOUT and return.
- #err ⇒ Object
- #quote ⇒ Object
Methods inherited from DaemonKit::RuotePseudoParticipant
#handle_exception, on_complete, on_exception, #perform, #run_callbacks
Instance Method Details
#dammit(exception) ⇒ Object
22 23 24 |
# File 'lib/generators/daemon_kit/ruote/templates/lib/sample.rb', line 22 def dammit( exception ) workitem["error"] = exception. end |
#echo(payload) ⇒ Object
Print to STDOUT and return
7 8 9 10 |
# File 'lib/generators/daemon_kit/nanite_agent/templates/lib/actors/sample.rb', line 7 def echo( payload ) p payload payload end |
#err ⇒ Object
18 19 20 |
# File 'lib/generators/daemon_kit/ruote/templates/lib/sample.rb', line 18 def err raise ArgumentError, "Does not compute" end |
#quote ⇒ Object
14 15 16 |
# File 'lib/generators/daemon_kit/ruote/templates/lib/sample.rb', line 14 def quote workitem["quote"] = open("http://www.iheartquotes.com/api/v1/random").read end |