-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Westeros decks/cards #38
base: master
Are you sure you want to change the base?
Conversation
We need to fix the westeros_cards yaml. Some cards are duplicate, so we have to duplicate them there. |
available_positions = (1..deck.westeros_cards.size).to_a | ||
deck.westeros_cards.each do |card| | ||
new_position = random_position(available_positions) | ||
card.update(revealed: false) if card.revealed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test for this if
?
end | ||
end | ||
|
||
def create_cards |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you improve this method?
decks.each do |deck| | ||
hide_previous_card(deck) | ||
card = revealed_card(deck) | ||
card.update(revealed: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would make more sense to put this update
inside revealed_card
No description provided.