Class: ChessData::Counter

Inherits:
Object
  • Object
show all
Defined in:
lib/chess_data/position-definition.rb

Overview

parent class for the different types of count comparators

Direct Known Subclasses

AtLeastCount, AtMostCount, ExactCount

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(n, piece) ⇒ Counter

Each counter has a target piece and reference number n.



73
74
75
76
# File 'lib/chess_data/position-definition.rb', line 73

def initialize n, piece
  @n = n
  @piece = piece
end

Instance Attribute Details

#pieceObject (readonly)

Returns the value of attribute piece.



70
71
72
# File 'lib/chess_data/position-definition.rb', line 70

def piece
  @piece
end