Class: Noah::Hosts

Inherits:
Object
  • Object
show all
Defined in:
lib/noah/models/hosts.rb

Class Method Summary collapse

Class Method Details

.all(options = {}) ⇒ Array

Returns Array of Noah::Host objects.

Parameters:

  • optional (Hash)

    filters for results

Returns:



56
57
58
59
60
61
# File 'lib/noah/models/hosts.rb', line 56

def self.all(options = {})
  host_hash = Hash.new
  options.empty? ? hosts=Noah::Host.all.sort : hosts=Noah::Host.find(options).sort
  hosts.each {|x| host_hash["#{x.name}"] = x.to_hash.reject {|k,v| k == :name } }
  host_hash
end