Class: OvirtMetrics::OvirtHistory

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/ovirt_metrics/models/ovirt_history.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#connection_specification_name=(value) ⇒ Object (writeonly)

Sets the attribute connection_specification_name

Parameters:

  • value

    the value to set the attribute connection_specification_name to.



3
4
5
# File 'lib/ovirt_metrics/models/ovirt_history.rb', line 3

def connection_specification_name=(value)
  @connection_specification_name = value
end

Class Method Details

.connection_specification_nameObject



8
9
10
11
12
13
# File 'lib/ovirt_metrics/models/ovirt_history.rb', line 8

def self.connection_specification_name
  if !defined?(@connection_specification_name) || @connection_specification_name.nil?
    return self == OvirtHistory ? OvirtMetrics.config.connection_specification_name : superclass.connection_specification_name
  end
  @connection_specification_name
end

.with_time_range(start_time = nil, end_time = nil) ⇒ Object



15
16
17
18
# File 'lib/ovirt_metrics/models/ovirt_history.rb', line 15

def self.with_time_range(start_time = nil, end_time = nil)
  return all if start_time.nil?
  where(:history_datetime => (start_time..(end_time || Time.now.utc)))
end