Class: Localjob
- Inherits:
-
Object
- Object
- Localjob
- Extended by:
- Forwardable
- Defined in:
- lib/localjob.rb,
lib/localjob/cli.rb,
lib/localjob/worker.rb,
lib/localjob/channel.rb,
lib/localjob/version.rb,
lib/localjob/mock_adapter.rb,
lib/localjob/sysv_adapter.rb,
lib/localjob/linux_adapter.rb
Defined Under Namespace
Classes: CLI, Channel, LinuxAdapter, MockAdapter, SysvAdapter, Worker
Constant Summary collapse
- VERSION =
"0.1.1"
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#queue ⇒ Object
Returns the value of attribute queue.
Instance Method Summary collapse
- #<<(object) ⇒ Object
-
#initialize(name = "localjob") ⇒ Localjob
constructor
A new instance of Localjob.
- #serializer ⇒ Object
- #shift ⇒ Object
Constructor Details
#initialize(name = "localjob") ⇒ Localjob
Returns a new instance of Localjob.
24 25 26 |
# File 'lib/localjob.rb', line 24 def initialize(name = "localjob") @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
19 20 21 |
# File 'lib/localjob.rb', line 19 def name @name end |
#queue ⇒ Object
Returns the value of attribute queue.
20 21 22 |
# File 'lib/localjob.rb', line 20 def queue @queue end |
Instance Method Details
#<<(object) ⇒ Object
43 44 45 |
# File 'lib/localjob.rb', line 43 def <<(object) queue.send serializer.dump(object) end |
#serializer ⇒ Object
28 29 30 |
# File 'lib/localjob.rb', line 28 def serializer YAML end |
#shift ⇒ Object
47 48 49 |
# File 'lib/localjob.rb', line 47 def shift serializer.load queue.receive end |