Class: WeebSh::Shimakaze
- Defined in:
- lib/weeb/interfaces/shimakaze.rb
Overview
Reputation API
Instance Attribute Summary
Attributes inherited from Interface
Instance Method Summary collapse
-
#bot(bot) ⇒ ShimakazeBot
Makes a class with your bot ID to do requests easier.
-
#get(bot, user) ⇒ User
Get’s a user.
-
#settings ⇒ ReputationSettings
Gets the currentyly used settings.
Methods inherited from Interface
Constructor Details
This class inherits a constructor from WeebSh::Interface
Instance Method Details
#bot(bot) ⇒ ShimakazeBot
Makes a class with your bot ID to do requests easier
10 11 12 |
# File 'lib/weeb/interfaces/shimakaze.rb', line 10 def bot(bot) ShimakazeBot.new(bot, self) end |
#get(bot, user) ⇒ User
Get’s a user
18 19 20 21 22 23 |
# File 'lib/weeb/interfaces/shimakaze.rb', line 18 def get(bot, user) user_id = user.resolve_id if user.respond_to?(:resolve_id) response = API::Shimakaze.get(self, bot, user_id || user) user.patch(response['user']) if user.is_a?(User) new User(response['user'], self) end |
#settings ⇒ ReputationSettings
Gets the currentyly used settings
27 28 29 |
# File 'lib/weeb/interfaces/shimakaze.rb', line 27 def settings new ReputationSettings(response['settings'], self) end |