Included Modules

Class/Module Index [+]

Quicksearch

RHC::Rest::Mock::MockRestDomain

Public Instance Methods

add_application(name, type=nil, scale=nil, gear_profile='default', git_url=nil) click to toggle source
# File lib/rhc/rest/mock.rb, line 677
def add_application(name, type=nil, scale=nil, gear_profile='default', git_url=nil)
  if type.is_a?(Hash)
    scale = type[:scale]
    gear_profile = type[:gear_profile]
    git_url = type[:initial_git_url]
    type = Array(type[:cartridges] || type[:cartridge])
  end
  a = MockRestApplication.new(client, name, type, self, scale, gear_profile, git_url)
  builder = @applications.find{ |app| app.cartridges.map(&:name).any?{ |s| s =~ /^jenkins-[\d\.]+$/ } }
  a.building_app = builder.name if builder
  @applications << a
  a.add_message("Success")
  a
end
add_member(member) click to toggle source
# File lib/rhc/rest/mock.rb, line 696
def add_member(member)
  (@members ||= []) << member
  self
end
applications(*args) click to toggle source
# File lib/rhc/rest/mock.rb, line 692
def applications(*args)
  @applications
end
destroy(force=false) click to toggle source
# File lib/rhc/rest/mock.rb, line 670
def destroy(force=false)
  raise RHC::Rest::ClientErrorException.new("Applications must be empty.") unless @applications.empty? or force.present?
  client.domains.delete_if { |d| d.name == @name }

  @applications = nil
end
rename(id) click to toggle source
# File lib/rhc/rest/mock.rb, line 665
def rename(id)
  @name = id
  self
end

Public Class Methods

new(client, id) click to toggle source
# File lib/rhc/rest/mock.rb, line 658
def initialize(client, id)
  super({}, client)
  @name = id
  @applications = []
  self.attributes = {:links => mock_response_links(mock_domain_links(id))}
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.