Class: MetricsAdapter::Adapters::Keen
- Inherits:
-
Object
- Object
- MetricsAdapter::Adapters::Keen
- Defined in:
- lib/metrics_adapter/adapters/keen.rb
Instance Attribute Summary collapse
-
#project_id ⇒ Object
readonly
Returns the value of attribute project_id.
-
#write_key ⇒ Object
readonly
Returns the value of attribute write_key.
Instance Method Summary collapse
-
#initialize(options) ⇒ Keen
constructor
A new instance of Keen.
- #publish(data) ⇒ Object
Constructor Details
#initialize(options) ⇒ Keen
Returns a new instance of Keen.
6 7 8 9 |
# File 'lib/metrics_adapter/adapters/keen.rb', line 6 def initialize() @project_id = .fetch(:project_id) @write_key = .fetch(:write_key) end |
Instance Attribute Details
#project_id ⇒ Object (readonly)
Returns the value of attribute project_id.
4 5 6 |
# File 'lib/metrics_adapter/adapters/keen.rb', line 4 def project_id @project_id end |
#write_key ⇒ Object (readonly)
Returns the value of attribute write_key.
4 5 6 |
# File 'lib/metrics_adapter/adapters/keen.rb', line 4 def write_key @write_key end |
Instance Method Details
#publish(data) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/metrics_adapter/adapters/keen.rb', line 11 def publish(data) name = data.delete(:name) ::Keen.project_id = project_id ::Keen.write_key = write_key ::Keen.publish(name, data) end |