Class: Cucumber::Ast::Table::Cell

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/ast/table.rb

Direct Known Subclasses

SurplusCell

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, table, line) ⇒ Cell

Returns a new instance of Cell.



554
555
556
# File 'lib/cucumber/ast/table.rb', line 554

def initialize(value, table, line)
  @value, @table, @line = value, table, line
end

Instance Attribute Details

#lineObject (readonly)

Returns the value of attribute line.



551
552
553
# File 'lib/cucumber/ast/table.rb', line 551

def line
  @line
end

#statusObject

Returns the value of attribute status.



552
553
554
# File 'lib/cucumber/ast/table.rb', line 552

def status
  @status
end

#tableObject (readonly)

Returns the value of attribute table.



551
552
553
# File 'lib/cucumber/ast/table.rb', line 551

def table
  @table
end

#valueObject

Returns the value of attribute value.



552
553
554
# File 'lib/cucumber/ast/table.rb', line 552

def value
  @value
end

Instance Method Details

#==(o) ⇒ Object



567
568
569
# File 'lib/cucumber/ast/table.rb', line 567

def ==(o)
  SurplusCell === o || value == o.value
end

#accept(visitor) ⇒ Object



558
559
560
561
# File 'lib/cucumber/ast/table.rb', line 558

def accept(visitor)
  return if $cucumber_interrupted
  visitor.visit_table_cell_value(value, status)
end

#inspect!Object



563
564
565
# File 'lib/cucumber/ast/table.rb', line 563

def inspect!
  @value = "(i) #{value.inspect}"
end

#to_sexpObject

For testing only



572
573
574
# File 'lib/cucumber/ast/table.rb', line 572

def to_sexp #:nodoc:
  [:cell, @value]
end