Class: RRD::DataSource
- Inherits:
-
Object
- Object
- RRD::DataSource
- Defined in:
- lib/rrd/data_source.rb
Constant Summary collapse
- PARAMS =
[ :min_heartbeat, :min_value, :max_value ]
Instance Attribute Summary collapse
-
#last_ds ⇒ Object
Returns the value of attribute last_ds.
-
#last_value ⇒ Object
Returns the value of attribute last_value.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#type ⇒ Object
Returns the value of attribute type.
-
#unknown_seconds ⇒ Object
Returns the value of attribute unknown_seconds.
Class Method Summary collapse
Instance Method Summary collapse
- #cdp ⇒ Object
-
#initialize(name, type, options = {}) ⇒ DataSource
constructor
A new instance of DataSource.
- #inspect ⇒ Object
Constructor Details
#initialize(name, type, options = {}) ⇒ DataSource
Returns a new instance of DataSource.
9 10 11 12 |
# File 'lib/rrd/data_source.rb', line 9 def initialize(name, type, = {}) @name, @type = name, type @options = end |
Instance Attribute Details
#last_ds ⇒ Object
Returns the value of attribute last_ds.
7 8 9 |
# File 'lib/rrd/data_source.rb', line 7 def last_ds @last_ds end |
#last_value ⇒ Object
Returns the value of attribute last_value.
7 8 9 |
# File 'lib/rrd/data_source.rb', line 7 def last_value @last_value end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/rrd/data_source.rb', line 7 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/rrd/data_source.rb', line 7 def @options end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/rrd/data_source.rb', line 7 def type @type end |
#unknown_seconds ⇒ Object
Returns the value of attribute unknown_seconds.
7 8 9 |
# File 'lib/rrd/data_source.rb', line 7 def unknown_seconds @unknown_seconds end |
Class Method Details
.parse(reader) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rrd/data_source.rb', line 14 def self.parse(reader) name = reader.read_string(20, "A*") type = reader.read_string(20, "A*") params = Hash[PARAMS.zip(reader.read_uniparams(10))] = { min_heartbeat: params[:min_heartbeat].to_i, min_value: params[:min_value].to_f, max_value: params[:max_value].to_f } DataSource.new(name, type, ) end |
Instance Method Details
#cdp ⇒ Object
28 29 30 |
# File 'lib/rrd/data_source.rb', line 28 def cdp @cdp ||= [] end |
#inspect ⇒ Object
32 33 34 |
# File 'lib/rrd/data_source.rb', line 32 def inspect "<RRD::DataSource name='#{name}' type='#{type}' options='#{}'>" end |