Method: Botbckt::StarJar#pop

Defined in:
lib/botbckt/commands/star_jar.rb

#pop(user, &block) ⇒ Object

Removes a star from the jar for the user

Parameters

user<String>

The user being docked a star. Required.



31
32
33
34
35
36
37
38
39
40
# File 'lib/botbckt/commands/star_jar.rb', line 31

def pop(user, &block)
  get "starjar-#{user}" do |stars|
  
    if stars
      set "starjar-#{user}", stars - 1, &block
    else
      set "starjar-#{user}", 0, &block
    end
  end
end