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

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

Overview

:nodoc:

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.



655
656
657
# File 'lib/cucumber/ast/table.rb', line 655

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

Instance Attribute Details

#lineObject (readonly)

Returns the value of attribute line.



652
653
654
# File 'lib/cucumber/ast/table.rb', line 652

def line
  @line
end

#statusObject

Returns the value of attribute status.



653
654
655
# File 'lib/cucumber/ast/table.rb', line 653

def status
  @status
end

#tableObject (readonly)

Returns the value of attribute table.



652
653
654
# File 'lib/cucumber/ast/table.rb', line 652

def table
  @table
end

#valueObject

Returns the value of attribute value.



653
654
655
# File 'lib/cucumber/ast/table.rb', line 653

def value
  @value
end

Instance Method Details

#==(o) ⇒ Object



668
669
670
# File 'lib/cucumber/ast/table.rb', line 668

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

#accept(visitor) ⇒ Object



659
660
661
662
# File 'lib/cucumber/ast/table.rb', line 659

def accept(visitor)
  return if Cucumber.wants_to_quit
  visitor.visit_table_cell_value(value, status)
end

#inspect!Object



664
665
666
# File 'lib/cucumber/ast/table.rb', line 664

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

#to_sexpObject

For testing only



673
674
675
# File 'lib/cucumber/ast/table.rb', line 673

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