Class: KalibroClient::Entities::Configurations::KalibroRange

Inherits:
Base
  • Object
show all
Includes:
RangeMethods
Defined in:
lib/kalibro_client/entities/configurations/kalibro_range.rb

Instance Attribute Summary collapse

Attributes included from DateAttributes

#created_at, #updated_at

Attributes inherited from Base

#kalibro_errors, #persisted

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RangeMethods

#beginning=, #end=, #range

Methods inherited from Base

address

Methods inherited from Base

#==, create, create_array_from_hash, create_objects_array_from_hash, #destroy, exists?, find, #initialize, 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, #save_action, #update_params

Constructor Details

This class inherits a constructor from KalibroClient::Entities::Base

Instance Attribute Details

#beginningObject (readonly)

Returns the value of attribute beginning.



24
25
26
# File 'lib/kalibro_client/entities/configurations/kalibro_range.rb', line 24

def beginning
  @beginning
end

#commentsObject

Returns the value of attribute comments.



23
24
25
# File 'lib/kalibro_client/entities/configurations/kalibro_range.rb', line 23

def comments
  @comments
end

#endObject (readonly)

Returns the value of attribute end.



24
25
26
# File 'lib/kalibro_client/entities/configurations/kalibro_range.rb', line 24

def end
  @end
end

#idObject

Returns the value of attribute id.



23
24
25
# File 'lib/kalibro_client/entities/configurations/kalibro_range.rb', line 23

def id
  @id
end

#metric_configuration_idObject

Returns the value of attribute metric_configuration_id.



23
24
25
# File 'lib/kalibro_client/entities/configurations/kalibro_range.rb', line 23

def metric_configuration_id
  @metric_configuration_id
end

#reading_idObject

Returns the value of attribute reading_id.



23
24
25
# File 'lib/kalibro_client/entities/configurations/kalibro_range.rb', line 23

def reading_id
  @reading_id
end

Class Method Details

.ranges_of(metric_configuration_id) ⇒ Object



51
52
53
# File 'lib/kalibro_client/entities/configurations/kalibro_range.rb', line 51

def self.ranges_of(metric_configuration_id)
  self.create_objects_array_from_hash(request('', {}, :get, "metric_configurations/#{metric_configuration_id}"))
end

Instance Method Details

#colorObject



47
48
49
# File 'lib/kalibro_client/entities/configurations/kalibro_range.rb', line 47

def color
  reading.color
end

#gradeObject



43
44
45
# File 'lib/kalibro_client/entities/configurations/kalibro_range.rb', line 43

def grade
  reading.grade
end

#labelObject



39
40
41
# File 'lib/kalibro_client/entities/configurations/kalibro_range.rb', line 39

def label
  reading.label
end

#readingObject



55
56
57
58
# File 'lib/kalibro_client/entities/configurations/kalibro_range.rb', line 55

def reading
  @reading ||= KalibroClient::Entities::Configurations::Reading.find(reading_id)
  @reading
end