Class: Capistrano::Command::Tree::ConditionBranch

Inherits:
Branch
  • Object
show all
Defined in:
lib/capistrano/command.rb

Defined Under Namespace

Classes: Evaluator

Instance Attribute Summary collapse

Attributes inherited from Branch

#callback, #command, #options

Instance Method Summary collapse

Methods inherited from Branch

#last?, #skip!, #skip?

Constructor Details

#initialize(configuration, condition, command, options, callback) ⇒ ConditionBranch

Returns a new instance of ConditionBranch.



83
84
85
86
87
# File 'lib/capistrano/command.rb', line 83

def initialize(configuration, condition, command, options, callback)
  @configuration = configuration
  @condition = condition
  super(command, options, callback)
end

Instance Attribute Details

#conditionObject

Returns the value of attribute condition.



53
54
55
# File 'lib/capistrano/command.rb', line 53

def condition
  @condition
end

#configurationObject

Returns the value of attribute configuration.



52
53
54
# File 'lib/capistrano/command.rb', line 52

def configuration
  @configuration
end

Instance Method Details

#match(server) ⇒ Object



89
90
91
# File 'lib/capistrano/command.rb', line 89

def match(server)
  Evaluator.new(configuration, condition, server).result
end

#to_sObject



93
94
95
# File 'lib/capistrano/command.rb', line 93

def to_s
  "#{condition.inspect} :: #{command.inspect}"
end