Class: Capissh::Command::Tree::ConditionBranch

Inherits:
Branch
  • Object
show all
Defined in:
lib/capissh/command/tree.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.



74
75
76
77
78
# File 'lib/capissh/command/tree.rb', line 74

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.



44
45
46
# File 'lib/capissh/command/tree.rb', line 44

def condition
  @condition
end

#configurationObject

Returns the value of attribute configuration.



43
44
45
# File 'lib/capissh/command/tree.rb', line 43

def configuration
  @configuration
end

Instance Method Details

#match(server) ⇒ Object



80
81
82
# File 'lib/capissh/command/tree.rb', line 80

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

#to_sObject



84
85
86
# File 'lib/capissh/command/tree.rb', line 84

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