Class: WeebSh::Shimakaze

Inherits:
Interface show all
Defined in:
lib/weeb/interfaces/shimakaze.rb

Overview

Reputation API

Instance Attribute Summary

Attributes inherited from Interface

#api_url, #auth, #user_agent

Instance Method Summary collapse

Methods inherited from Interface

#initialize

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

#settingsReputationSettings

Gets the currentyly used settings


27
28
29
# File 'lib/weeb/interfaces/shimakaze.rb', line 27

def settings
  new ReputationSettings(response['settings'], self)
end