class WeebSh::ReputationSettings

Represents a reputation settings object for shimakaze

Attributes

account[RW]

@return [String, nil] the ID of the account from the token

max_rep[RW]

@return [Integer] the maximum reputation a user may receive

max_rep_per_day[RW]

@return [Integer] the maximum reputation a user may receive per day

max_reputation[RW]

@return [Integer] the maximum reputation a user may receive

max_reputation_per_day[RW]

@return [Integer] the maximum reputation a user may receive per day

rep_cooldown[RW]

@return [Integer] the cooldown per reputation, this is set to time in seconds

rep_per_day[RW]

@return [Integer] the number of reputations a user may give out per cooldown

reputation_cooldown[RW]

@return [Integer] the cooldown per reputation, this is set to time in seconds

reputation_per_day[RW]

@return [Integer] the number of reputations a user may give out per cooldown

Public Class Methods

new(data, interface) click to toggle source

@!visibility private

# File lib/weeb/data.rb, line 308
def initialize(data, interface)
  @interface = interface
  @reputation_per_day = data['reputationPerDay']
  @max_reputation = data['maximumReputation']
  @max_reputation_per_day = data['maximumReputationReceivedDay']
  @reputation_cooldown = data['reputationCooldown']
  @account = data['account']
end

Public Instance Methods

inspect() click to toggle source

@!visibility private

# File lib/weeb/data.rb, line 330
def inspect
  "#<WeebSh::ReputationSettings @reputation_per_day=#{@reputation_per_day.inspect} @max_reputation=#{@max_reputation.inspect} @max_reputation_per_day=#{@max_reputation_per_day.inspect} @reputation_cooldown=#{@reputation_cooldown.inspect}>"
end
save() click to toggle source

Save the settings on this object @return [ReputationSettings] the class itself

# File lib/weeb/data.rb, line 319
def save
  WeebSh::API::Shimakaze.set_settings(@interface, {
    reputationPerDay: @reputation_per_day,
    maximumReputation: @max_reputation,
    maximumReputationReceivedDay: @max_reputation_per_day,
    reputationCooldown: @reputation_cooldown
  })
  self
end