Class: Trebor::With

Inherits:
Object
  • Object
show all
Includes:
InnerDomain
Defined in:
lib/trebor/with.rb

Instance Attribute Summary collapse

Attributes included from Domain

#parent

Instance Method Summary collapse

Methods included from InnerDomain

#action, #ssh

Methods included from Domain

#current_directory, #toplevel

Constructor Details

#initialize(parent, environment) ⇒ With

Returns a new instance of With.



7
8
9
10
11
12
13
14
15
# File 'lib/trebor/with.rb', line 7

def initialize(parent, environment)
  @environment  = environment.map do |key, val|
    "#{key.upcase}=#{val}"
  end.join(" ")
  @command      = parent.command
  @parent       = parent

  self.extend @command
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



5
6
7
# File 'lib/trebor/with.rb', line 5

def command
  @command
end

#environmentObject (readonly)

Returns the value of attribute environment.



5
6
7
# File 'lib/trebor/with.rb', line 5

def environment
  @environment
end

Instance Method Details

#fetch(command) ⇒ Object



17
18
19
# File 'lib/trebor/with.rb', line 17

def fetch(command)
  parent.fetch("%s %s" % [environment, command])
end