Class: RightScale::Deployment

Inherits:
Base
  • Object
show all
Defined in:
lib/right_api/rightscale.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

all, class_name, #data, establish_connection, find, first, #id, #initialize, plural_name, #update_attribute, xml_name

Methods included from AccessibleFragment

#get_element, #has_element?, #initialize, #method_missing

Constructor Details

This class inherits a constructor from RightScale::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class AccessibleFragment

Class Method Details

.find_by_nickname(nickname) ⇒ Object



109
110
111
112
113
114
115
116
117
# File 'lib/right_api/rightscale.rb', line 109

def self.find_by_nickname(nickname)
  deployments = all.select { |deployment| deployment.nickname == nickname }
  
  if deployments.size != 1
    raise "Found #{deployments.size} deployments matching #{nickname}. Double check your nickname, it should be exact to avoid hitting the deployment."
  end
  
  deployments.first
end

Instance Method Details

#serversObject



119
120
121
# File 'lib/right_api/rightscale.rb', line 119

def servers
  (@data / 'server').map {|data| Server.new(data)}
end