Class: Rgviz::Label

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(column, label) ⇒ Label

Returns a new instance of Label.



159
160
161
162
# File 'lib/rgviz/nodes.rb', line 159

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

Instance Attribute Details

#columnObject

Returns the value of attribute column.



156
157
158
# File 'lib/rgviz/nodes.rb', line 156

def column
  @column
end

#labelObject

Returns the value of attribute label.



157
158
159
# File 'lib/rgviz/nodes.rb', line 157

def label
  @label
end

Instance Method Details

#accept(visitor) ⇒ Object



164
165
166
167
168
169
# File 'lib/rgviz/nodes.rb', line 164

def accept(visitor)
  if visitor.visit_label(self)
    column.accept visitor
  end
  visitor.end_visit_label self
end

#to_sObject



171
172
173
# File 'lib/rgviz/nodes.rb', line 171

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