Class: Judge
- Inherits:
-
Object
- Object
- Judge
- Defined in:
- lib/judge.rb
Instance Attribute Summary collapse
-
#cards ⇒ Object
readonly
Pintas C,O,P,E.
-
#vira ⇒ Object
Returns the value of attribute vira.
Instance Method Summary collapse
-
#initialize(cards) ⇒ Judge
constructor
A new instance of Judge.
- #suit_rank ⇒ Object
- #winner ⇒ Object
Constructor Details
#initialize(cards) ⇒ Judge
Returns a new instance of Judge.
16 17 18 |
# File 'lib/judge.rb', line 16 def initialize(cards) @cards = cards end |
Instance Attribute Details
#cards ⇒ Object (readonly)
Pintas C,O,P,E
13 14 15 |
# File 'lib/judge.rb', line 13 def cards @cards end |
#vira ⇒ Object
Returns the value of attribute vira.
14 15 16 |
# File 'lib/judge.rb', line 14 def vira @vira end |
Instance Method Details
#suit_rank ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/judge.rb', line 26 def suit_rank [ :"E", :"P", :"O", :"C" ] end |
#winner ⇒ Object
20 21 22 23 24 |
# File 'lib/judge.rb', line 20 def winner return perico if perico return perica if perica cards.sort[-1] end |