Class: Judge

Inherits:
Object
  • Object
show all
Defined in:
lib/judge.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#cardsObject (readonly)

Pintas C,O,P,E



13
14
15
# File 'lib/judge.rb', line 13

def cards
  @cards
end

#viraObject

Returns the value of attribute vira.



14
15
16
# File 'lib/judge.rb', line 14

def vira
  @vira
end

Instance Method Details

#suit_rankObject



26
27
28
29
30
31
32
33
# File 'lib/judge.rb', line 26

def suit_rank
  [
    :"E",
    :"P",
    :"O",
    :"C"
  ]
end

#winnerObject



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