Class: Scorecard::Badger
- Inherits:
-
Object
- Object
- Scorecard::Badger
- Defined in:
- lib/scorecard/badger.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(user, badge) ⇒ Badger
constructor
A new instance of Badger.
- #update ⇒ Object
Constructor Details
#initialize(user, badge) ⇒ Badger
Returns a new instance of Badger.
8 9 10 |
# File 'lib/scorecard/badger.rb', line 8 def initialize(user, badge) @user, @badge = user, badge end |
Class Method Details
Instance Method Details
#update ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/scorecard/badger.rb', line 12 def update if badge.check.call user return unless existing.empty? || badge.repeatable? remove_old add_new else remove_all end end |