Class: Cloudpassage::Server

Inherits:
Single show all
Defined in:
lib/cloudpassage/servers.rb

Instance Attribute Summary

Attributes inherited from Single

#id

Instance Method Summary collapse

Methods inherited from Single

#get

Methods inherited from Base

#[], #data, #headers, #method_missing, #object_symbol, #post, #reload, #wait_for

Constructor Details

#initialize(token, base_resource, id, data = nil) ⇒ Server

Returns a new instance of Server.



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

def initialize(token, base_resource, id, data=nil)
  @id = id
  super(token, RestClient::Resource.new("#{BASE_URL}/servers/"), @id, data)
end

Dynamic Method Handling

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

Instance Method Details

#accountsObject



20
21
22
# File 'lib/cloudpassage/servers.rb', line 20

def accounts
  Accounts.new(self, @token, @base_resource['accounts'])
end

#command(id) ⇒ Object



29
30
31
# File 'lib/cloudpassage/servers.rb', line 29

def command(id)
  commands.get(id)
end

#commandsObject



25
26
27
# File 'lib/cloudpassage/servers.rb', line 25

def commands
  Commands.new(@token, @base_resource['commands'])
end

#issuesObject



16
17
18
# File 'lib/cloudpassage/servers.rb', line 16

def issues
  Issues.new(@token, @base_resource['issues'])
end