Class: JustGo::Chain
- Inherits:
-
Object
- Object
- JustGo::Chain
- Extended by:
- Forwardable
- Defined in:
- lib/just_go/chain.rb
Overview
Chain
A collection of Points with stones of the same chain id
Instance Attribute Summary collapse
-
#points ⇒ Object
readonly
Returns the value of attribute points.
Instance Method Summary collapse
-
#initialize(points: []) ⇒ Chain
constructor
A new instance of Chain.
- #player_number ⇒ Object
Constructor Details
#initialize(points: []) ⇒ Chain
Returns a new instance of Chain.
11 12 13 |
# File 'lib/just_go/chain.rb', line 11 def initialize(points: []) @points = points end |
Instance Attribute Details
#points ⇒ Object (readonly)
Returns the value of attribute points.
15 16 17 |
# File 'lib/just_go/chain.rb', line 15 def points @points end |
Instance Method Details
#player_number ⇒ Object
19 20 21 |
# File 'lib/just_go/chain.rb', line 19 def player_number points.first.stone.player_number end |