Class: DashingContrib::Kue::Client
- Inherits:
-
Object
- Object
- DashingContrib::Kue::Client
- Defined in:
- lib/dashing-contrib/bottles/kue/client.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
- Creates a new Kue Client Arguments: endpoint
-
endpoint of Kue web interface.
-
#stats ⇒ Object
Returns a stats summary of Kue status in following format.
Constructor Details
#initialize(options = {}) ⇒ Client
Creates a new Kue Client Arguments:
- endpoint
-
endpoint of Kue web interface
12 13 14 |
# File 'lib/dashing-contrib/bottles/kue/client.rb', line 12 def initialize( = {}) @endpoint = [:endpoint] end |
Instance Attribute Details
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
6 7 8 |
# File 'lib/dashing-contrib/bottles/kue/client.rb', line 6 def endpoint @endpoint end |
Instance Method Details
#stats ⇒ Object
Returns a stats summary of Kue status in following format
Tries to transform from camalCase JSON key to ruby friendly symbal underscore format
{
:inactive_count: 235,
:complete_count: 29426,
:active_count: 4,
:failed_count: 11,
:delayed_count: 0,
:work_time: 778205330
}
30 31 32 33 34 35 36 |
# File 'lib/dashing-contrib/bottles/kue/client.rb', line 30 def stats payload = {} get_request('stats').each do |key, value| payload[:"#{key.underscore}"] = value end payload end |