module Voltaire

Constants

VERSION

Public Instance Methods

voltaire_down(amount, reputation, user) click to toggle source
# File lib/voltaire.rb, line 11
def voltaire_down(amount, reputation, user)
  get_user = User.find_by(id: user)
  get_user.reputation -= amount
  get_user.save
end
voltaire_down_other(amount, reputation, user, other) click to toggle source
# File lib/voltaire.rb, line 23
def voltaire_down_other(amount, reputation, user, other)
  get_other = other.find_by(id: user)
  get_other.reputation -= amount
  get_other.save      
end
voltaire_minus(amount, reputation, user) click to toggle source
# File lib/voltaire.rb, line 36
def voltaire_minus(amount, reputation, user)
  amount.times.collect do
    User.decrement_counter(reputation, user)
  end
end
voltaire_minus_other(amount, reputation, user, other) click to toggle source
# File lib/voltaire.rb, line 48
def voltaire_minus_other(amount, reputation, user, other)
  amount.times.collect do
    other.decrement_counter(reputation, user)
  end
end
voltaire_plus(amount, reputation, user) click to toggle source

FOR INCREMENTING

# File lib/voltaire.rb, line 30
def voltaire_plus(amount, reputation, user)
  amount.times.collect do
    User.increment_counter(reputation, user)
  end
end
voltaire_plus_other(amount, reputation, user, other) click to toggle source
# File lib/voltaire.rb, line 42
def voltaire_plus_other(amount, reputation, user, other)
  amount.times.collect do
    other.increment_counter(reputation, user)
  end
end
voltaire_up(amount, reputation, user) click to toggle source

FOR MORE THAN INCREMENTING BY 1

# File lib/voltaire.rb, line 5
def voltaire_up(amount, reputation, user)
  get_user = User.find_by(id: user)
  get_user.reputation += amount
  get_user.save
end
voltaire_up_other(amount, reputation, user, other) click to toggle source
# File lib/voltaire.rb, line 17
def voltaire_up_other(amount, reputation, user, other)
  get_other = other.find_by(id: user)
  get_other.reputation += amount
  get_other.save
end