Class: Dashboard

Inherits:
Object
  • Object
show all
Defined in:
app/models/dashboard.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filter = "") ⇒ Dashboard


9
10
11
12
13
# File 'app/models/dashboard.rb', line 9

def initialize(filter="")
  @filter = filter
  @report = {}
  fetch_data
end

Instance Attribute Details

#reportObject

Returns the value of attribute report


3
4
5
# File 'app/models/dashboard.rb', line 3

def report
  @report
end

Class Method Details

.status(filter = "") ⇒ Object

returns a status hash


5
6
7
# File 'app/models/dashboard.rb', line 5

def self.status(filter="")
  new(filter).report
end

Instance Method Details

#hostsObject


15
16
17
# File 'app/models/dashboard.rb', line 15

def hosts
  @hosts ||= Host.my_hosts.search_for(filter)
end