Class: WeebSh::ReputationSettings

Inherits:
Object
  • Object
show all
Includes:
IDObject
Defined in:
lib/weeb/data.rb

Overview

Represents a reputation settings object for shimakaze

Instance Attribute Summary collapse

Attributes included from IDObject

#id

Instance Method Summary collapse

Methods included from IDObject

#==

Instance Attribute Details

#accountString?

Returns the ID of the account from the token.

Returns:

  • (String, nil)

    the ID of the account from the token



305
306
307
# File 'lib/weeb/data.rb', line 305

def 
  @account
end

#max_reputationInteger Also known as: max_rep

Returns the maximum reputation a user may receive.

Returns:

  • (Integer)

    the maximum reputation a user may receive



293
294
295
# File 'lib/weeb/data.rb', line 293

def max_reputation
  @max_reputation
end

#max_reputation_per_dayInteger Also known as: max_rep_per_day

Returns the maximum reputation a user may receive per day.

Returns:

  • (Integer)

    the maximum reputation a user may receive per day



297
298
299
# File 'lib/weeb/data.rb', line 297

def max_reputation_per_day
  @max_reputation_per_day
end

#reputation_cooldownInteger Also known as: rep_cooldown

Returns the cooldown per reputation, this is set to time in seconds.

Returns:

  • (Integer)

    the cooldown per reputation, this is set to time in seconds



301
302
303
# File 'lib/weeb/data.rb', line 301

def reputation_cooldown
  @reputation_cooldown
end

#reputation_per_dayInteger Also known as: rep_per_day

Returns the number of reputations a user may give out per cooldown.

Returns:

  • (Integer)

    the number of reputations a user may give out per cooldown



289
290
291
# File 'lib/weeb/data.rb', line 289

def reputation_per_day
  @reputation_per_day
end

Instance Method Details

#saveReputationSettings

Save the settings on this object

Returns:



319
320
321
322
323
324
325
326
327
# 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