Class: KalibroGem::Entities::MetricConfiguration
- Defined in:
- lib/kalibro_gem/entities/metric_configuration.rb
Instance Attribute Summary collapse
-
#aggregation_form ⇒ Object
Returns the value of attribute aggregation_form.
-
#base_tool_name ⇒ Object
Returns the value of attribute base_tool_name.
-
#code ⇒ Object
Returns the value of attribute code.
-
#configuration_id ⇒ Object
Returns the value of attribute configuration_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#metric ⇒ Object
Returns the value of attribute metric.
-
#reading_group_id ⇒ Object
Returns the value of attribute reading_group_id.
-
#weight ⇒ Object
Returns the value of attribute weight.
Attributes inherited from Model
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Model
#==, create, create_array_from_hash, create_objects_array_from_hash, #destroy, #errors=, #initialize, request, #save, #save!, to_object, to_objects_array
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, #save_action
Constructor Details
This class inherits a constructor from KalibroGem::Entities::Model
Instance Attribute Details
#aggregation_form ⇒ Object
Returns the value of attribute aggregation_form.
23 24 25 |
# File 'lib/kalibro_gem/entities/metric_configuration.rb', line 23 def aggregation_form @aggregation_form end |
#base_tool_name ⇒ Object
Returns the value of attribute base_tool_name.
23 24 25 |
# File 'lib/kalibro_gem/entities/metric_configuration.rb', line 23 def base_tool_name @base_tool_name end |
#code ⇒ Object
Returns the value of attribute code.
23 24 25 |
# File 'lib/kalibro_gem/entities/metric_configuration.rb', line 23 def code @code end |
#configuration_id ⇒ Object
Returns the value of attribute configuration_id.
23 24 25 |
# File 'lib/kalibro_gem/entities/metric_configuration.rb', line 23 def configuration_id @configuration_id end |
#id ⇒ Object
Returns the value of attribute id.
23 24 25 |
# File 'lib/kalibro_gem/entities/metric_configuration.rb', line 23 def id @id end |
#metric ⇒ Object
Returns the value of attribute metric.
23 24 25 |
# File 'lib/kalibro_gem/entities/metric_configuration.rb', line 23 def metric @metric end |
#reading_group_id ⇒ Object
Returns the value of attribute reading_group_id.
23 24 25 |
# File 'lib/kalibro_gem/entities/metric_configuration.rb', line 23 def reading_group_id @reading_group_id end |
#weight ⇒ Object
Returns the value of attribute weight.
23 24 25 |
# File 'lib/kalibro_gem/entities/metric_configuration.rb', line 23 def weight @weight end |
Class Method Details
.exists?(id) ⇒ Boolean
63 64 65 66 67 68 69 |
# File 'lib/kalibro_gem/entities/metric_configuration.rb', line 63 def self.exists?(id) begin return true unless find(id).nil? rescue KalibroGem::Errors::RecordNotFound return false end end |
.find(id) ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/kalibro_gem/entities/metric_configuration.rb', line 50 def self.find(id) #TODO: on future versions of Kalibro this begin/rescue will be unnecessary begin new request(:get_metric_configuration, {:metric_configuration_id => id})[:metric_configuration] rescue Savon::SOAPFault raise KalibroGem::Errors::RecordNotFound end end |
.metric_configurations_of(configuration_id) ⇒ Object
59 60 61 |
# File 'lib/kalibro_gem/entities/metric_configuration.rb', line 59 def self.metric_configurations_of(configuration_id) create_objects_array_from_hash request(:metric_configurations_of, {:configuration_id => configuration_id})[:metric_configuration] end |
Instance Method Details
#to_hash ⇒ Object
46 47 48 |
# File 'lib/kalibro_gem/entities/metric_configuration.rb', line 46 def to_hash super :except => [:configuration_id] end |
#update_attributes(attributes = {}) ⇒ Object
41 42 43 44 |
# File 'lib/kalibro_gem/entities/metric_configuration.rb', line 41 def update_attributes(attributes={}) attributes.each { |field, value| send("#{field}=", value) if self.class.is_valid?(field) } save end |