This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Streak | |
| attr_accessor :username, :streak_dates | |
| def initialize | |
| @streak_dates = [] | |
| end | |
| def extend_streak | |
| self.streak_dates << Date.today unless self.streak_dates.include?(Date.today) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Member | |
| attr_accessor :username, :streak_dates | |
| def initialize(username) | |
| @username = username | |
| @streak_dates = [] | |
| end | |
| def practice | |
| self.streak_dates << Date.today unless self.streak_dates.include?(Date.today) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Interpolater | |
| attr_accessor :data, :template | |
| def initialize(template, data) | |
| @template = template | |
| @data = data | |
| replace_bracketed_words | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ChangeDispenserCashregister | |
| attr_accessor :total, :payment, :change_to_dispense | |
| COINS = { quarter: 25, dime: 10, nickel: 5, penny: 1 } | |
| def initialize | |
| get_total | |
| get_payment |
NewerOlder