Class: KalibroClient::Entities::Miscellaneous::CompoundMetric

Inherits:
Metric
  • Object
show all
Defined in:
lib/kalibro_client/entities/miscellaneous/compound_metric.rb

Instance Attribute Summary collapse

Attributes inherited from Metric

#code, #description, #name, #scope, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#==, #to_hash

Constructor Details

#initialize(name, code, scope, script) ⇒ CompoundMetric

Returns a new instance of CompoundMetric.



6
7
8
9
# File 'lib/kalibro_client/entities/miscellaneous/compound_metric.rb', line 6

def initialize(name, code, scope, script)
  super('CompoundMetricSnapshot', name, code, scope)
  @script = script
end

Instance Attribute Details

#scriptObject

Returns the value of attribute script.



5
6
7
# File 'lib/kalibro_client/entities/miscellaneous/compound_metric.rb', line 5

def script
  @script
end

Class Method Details

.to_object(value) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/kalibro_client/entities/miscellaneous/compound_metric.rb', line 11

def self.to_object(value)
  if value.is_a?(Hash)
    new(value['name'], value['code'], value['scope'], value['script'])
  else
    value
  end
end