Class: Cloudpassage::Servers

Inherits:
Base
  • Object
show all
Includes:
Collection
Defined in:
lib/cloudpassage/servers.rb

Instance Method Summary collapse

Methods included from Collection

#[], #all, #get, #to_s

Methods inherited from Base

#[], #data, #exists?, #headers, #initialize, #method_missing, #object_symbol, #post, #put, #reload, #wait_for

Constructor Details

This class inherits a constructor from Cloudpassage::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Cloudpassage::Base

Instance Method Details

#filter(options = {}) ⇒ Object



5
6
7
8
# File 'lib/cloudpassage/servers.rb', line 5

def filter(options={})
  servers = JSON.parse(@base_resource.get(headers.merge(:params=>options)), :symbolize_names=>true)[:servers]
  servers.map { |i| get(i[:id], i) }
end

#singleton_classObject



10
11
12
# File 'lib/cloudpassage/servers.rb', line 10

def singleton_class
  Server
end