Class: Capissh::Command::Tree::Branch

Inherits:
Object
  • Object
show all
Defined in:
lib/capissh/command/tree.rb

Direct Known Subclasses

ConditionBranch

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, options, callback) ⇒ Branch

Returns a new instance of Branch.



14
15
16
17
18
19
# File 'lib/capissh/command/tree.rb', line 14

def initialize(command, options, callback)
  @command = command.strip.gsub(/\r?\n/, "\\\n")
  @callback = callback || Capissh::Command.default_io_proc
  @options = options
  @skip = false
end

Instance Attribute Details

#callbackObject

Returns the value of attribute callback.



11
12
13
# File 'lib/capissh/command/tree.rb', line 11

def callback
  @callback
end

#commandObject

Returns the value of attribute command.



11
12
13
# File 'lib/capissh/command/tree.rb', line 11

def command
  @command
end

#optionsObject (readonly)

Returns the value of attribute options.



12
13
14
# File 'lib/capissh/command/tree.rb', line 12

def options
  @options
end

Instance Method Details

#last?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/capissh/command/tree.rb', line 21

def last?
  options[:last]
end

#match(server) ⇒ Object



33
34
35
# File 'lib/capissh/command/tree.rb', line 33

def match(server)
  true
end

#skip!Object



29
30
31
# File 'lib/capissh/command/tree.rb', line 29

def skip!
  @skip = true
end

#skip?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/capissh/command/tree.rb', line 25

def skip?
  @skip
end

#to_sObject



37
38
39
# File 'lib/capissh/command/tree.rb', line 37

def to_s
  command.inspect
end