Class: Bumbleworks::Worker::Proxy
- Inherits:
-
Object
- Object
- Bumbleworks::Worker::Proxy
- Defined in:
- lib/bumbleworks/worker/proxy.rb
Constant Summary collapse
- ProxiedAttributes =
[ :id, :pid, :ip, :hostname, :system, :launched_at, :state, :name, :class, :uptime ]
Instance Attribute Summary collapse
-
#raw_hash ⇒ Object
readonly
Returns the value of attribute raw_hash.
-
#state ⇒ Object
writeonly
Sets the attribute state.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #class_name ⇒ Object
-
#initialize(attributes) ⇒ Proxy
constructor
A new instance of Proxy.
- #launched_at ⇒ Object
-
#storage ⇒ Object
Allow storage to revert to the default for this Bumbleworks instance.
Constructor Details
#initialize(attributes) ⇒ Proxy
Returns a new instance of Proxy.
11 12 13 14 15 16 |
# File 'lib/bumbleworks/worker/proxy.rb', line 11 def initialize(attributes) @raw_hash = attributes ProxiedAttributes.each do |key| instance_variable_set(:"@#{key}", attributes[key.to_s]) end end |
Instance Attribute Details
#raw_hash ⇒ Object (readonly)
Returns the value of attribute raw_hash.
8 9 10 |
# File 'lib/bumbleworks/worker/proxy.rb', line 8 def raw_hash @raw_hash end |
#state=(value) ⇒ Object (writeonly)
Sets the attribute state
9 10 11 |
# File 'lib/bumbleworks/worker/proxy.rb', line 9 def state=(value) @state = value end |
Instance Method Details
#==(other) ⇒ Object
36 37 38 |
# File 'lib/bumbleworks/worker/proxy.rb', line 36 def ==(other) raw_hash == other.raw_hash end |
#class_name ⇒ Object
24 25 26 |
# File 'lib/bumbleworks/worker/proxy.rb', line 24 def class_name @class.to_s end |
#launched_at ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/bumbleworks/worker/proxy.rb', line 28 def launched_at if @launched_at.is_a?(String) Time.parse(@launched_at) else @launched_at end end |
#storage ⇒ Object
Allow storage to revert to the default for this Bumbleworks instance.
20 21 22 |
# File 'lib/bumbleworks/worker/proxy.rb', line 20 def storage nil end |