Class: Databox::Progress

Inherits:
Integration show all
Defined in:
lib/databox/integration.rb

Instance Attribute Summary

Attributes inherited from Integration

#date, #list, #name, #set_item

Attributes inherited from Client

#token

Instance Method Summary collapse

Methods inherited from Integration

#initialize, #save

Methods inherited from Client

#handle, #initialize, #key, #logs, #push, #url, #validate

Constructor Details

This class inherits a constructor from Databox::Integration

Instance Method Details

#add(*args) ⇒ Object



72
73
74
# File 'lib/databox/integration.rb', line 72

def add *args
  raise "Progress does not support add!"
end

#set(message, max, value) ⇒ Object



76
77
78
# File 'lib/databox/integration.rb', line 76

def set message, max, value
  @set_item = [message, max, value]
end

#to_dataObject



80
81
82
83
84
85
86
# File 'lib/databox/integration.rb', line 80

def to_data
  [
    { key: "#{name}@label",     value: @set_item.first },
    { key: "#{name}@max_value", value: @set_item[1] },
    { key: "#{name}",           value: @set_item.last },
  ]
end