Class: TextFSM::Options::List

Inherits:
Base
  • Object
show all
Defined in:
lib/textfsm/options.rb

Instance Attribute Summary

Attributes inherited from Base

#field

Instance Method Summary collapse

Methods inherited from Base

#initialize, #visible?

Constructor Details

This class inherits a constructor from TextFSM::Options::Base

Instance Method Details

#after_assign ⇒ Object



67
68
69
70
# File 'lib/textfsm/options.rb', line 67

def after_assign
  match = field.pattern.match(field.value) if field.value && !field.pattern.names.empty?
  @items << (match ? field.pattern.named_captures(match) : field.value)
end

#after_clear ⇒ Object



72
73
74
# File 'lib/textfsm/options.rb', line 72

def after_clear
  @items = [] unless field.option?("Filldown")
end

#after_initialize ⇒ Object



63
64
65
# File 'lib/textfsm/options.rb', line 63

def after_initialize
  @items = []
end

#after_reset ⇒ Object



76
77
78
# File 'lib/textfsm/options.rb', line 76

def after_reset
  @items = []
end

#before_record ⇒ Object



80
81
82
# File 'lib/textfsm/options.rb', line 80

def before_record
  field.value = @items.dup
end