class Rubble::Scope

Attributes

environment[R]
server[R]

Public Class Methods

new(environment, server) click to toggle source
# File lib/rubble/scope.rb, line 5
def initialize(environment, server)
    @environment = environment
    @server = server
end

Public Instance Methods

configure_plan(type, *params, &block) click to toggle source
# File lib/rubble/scope.rb, line 14
def configure_plan(type, *params, &block)
    plan = tool.create_plan(type, @environment, @server, *params)

    if not block.nil? then
        Docile.dsl_eval(plan, &block)
    end

    @environment.add_plan(plan)
end
method_missing(symbol, *arguments, &block) click to toggle source
Calls superclass method
# File lib/rubble/scope.rb, line 24
def method_missing(symbol, *arguments, &block)
    if tool.is_plan?(symbol) then
        configure_plan(symbol, *arguments, &block)
    elsif tool.is_target?(symbol) then
        @server.provide_target(symbol, arguments[0])
    elsif tool.is_resource?(symbol) then
        tool.provide_resource(symbol, arguments[0])
    else
        super
    end
end
respond_to?(symbol, include_private = false) click to toggle source
Calls superclass method
# File lib/rubble/scope.rb, line 36
def respond_to?(symbol, include_private = false)
    if tool.is_plan?(symbol) or tool.is_resource?(symbol) or tool.is_target?(symbol) then
        true
    else
        super
    end
end
tool() click to toggle source
# File lib/rubble/scope.rb, line 10
def tool
    @environment.tool
end