Class: KalibroClient::Entities::Processor::HotspotMetricResult

Inherits:
MetricResult show all
Defined in:
lib/kalibro_client/entities/processor/hotspot_metric_result.rb

Instance Attribute Summary collapse

Attributes inherited from MetricResult

#id, #metric_configuration, #metric_configuration_id, #module_result_id, #related_hotspot_metric_results_id, #value

Attributes included from DateAttributes

#created_at, #updated_at

Attributes inherited from Base

#kalibro_errors, #persisted

Instance Method Summary collapse

Methods inherited from MetricResult

#module_result

Methods inherited from Base

address

Methods inherited from Base

#==, create, create_array_from_hash, create_objects_array_from_hash, #destroy, exists?, find, request, #save, #save!, #to_hash, to_object, to_objects_array, #update

Methods included from RequestMethods::ClassMethods

#exists_action, #find_action, #id_params

Methods included from HashConverters

#convert_to_hash, #date_with_milliseconds, #field_to_hash

Methods included from XMLConverters

#get_xml, #xml_instance_class_name

Methods included from RequestMethods

#destroy_action, #destroy_params, #destroy_prefix, #save_action, #save_params, #save_prefix, #update_params, #update_prefix

Constructor Details

#initialize(attributes = {}, persisted = false) ⇒ HotspotMetricResult

Returns a new instance of HotspotMetricResult.



24
25
26
27
28
29
30
31
32
# File 'lib/kalibro_client/entities/processor/hotspot_metric_result.rb', line 24

def initialize(attributes={}, persisted=false)
  @line_number = attributes["line_number"].to_i
  attributes.each do |field, value|
    if field != "line_number" and self.class.is_valid?(field)
      send("#{field}=", value)
    end
  end
  @persisted = persisted
end

Instance Attribute Details

#line_numberObject

Returns the value of attribute line_number.



22
23
24
# File 'lib/kalibro_client/entities/processor/hotspot_metric_result.rb', line 22

def line_number
  @line_number
end

#messageObject

Returns the value of attribute message.



22
23
24
# File 'lib/kalibro_client/entities/processor/hotspot_metric_result.rb', line 22

def message
  @message
end

Instance Method Details



34
35
36
37
# File 'lib/kalibro_client/entities/processor/hotspot_metric_result.rb', line 34

def related_results
  HotspotMetricResult.create_objects_array_from_hash(self.class.request(":id/related_results",
                                                                        {id: self.id}, :get))
end