Class: Rgviz::Format

Inherits:
Object
  • Object
show all
Defined in:
lib/rgviz/nodes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(column, pattern) ⇒ Format

Returns a new instance of Format.



180
181
182
183
# File 'lib/rgviz/nodes.rb', line 180

def initialize(column, pattern)
  @column = column
  @pattern = pattern
end

Instance Attribute Details

#columnObject

Returns the value of attribute column.



177
178
179
# File 'lib/rgviz/nodes.rb', line 177

def column
  @column
end

#patternObject

Returns the value of attribute pattern.



178
179
180
# File 'lib/rgviz/nodes.rb', line 178

def pattern
  @pattern
end

Instance Method Details

#accept(visitor) ⇒ Object



185
186
187
188
189
190
# File 'lib/rgviz/nodes.rb', line 185

def accept(visitor)
  if visitor.visit_format(self)
    column.accept visitor
  end
  visitor.end_visit_format self
end

#to_sObject



192
193
194
# File 'lib/rgviz/nodes.rb', line 192

def to_s
  "#{column} `#{pattern}`"
end