Class: SlackbotFrd::SlackMethods::UsersInfo
- Inherits:
-
Object
- Object
- SlackbotFrd::SlackMethods::UsersInfo
- Includes:
- HTTParty
- Defined in:
- lib/slackbot_frd/slack_methods/users_info.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Class Method Summary collapse
Instance Method Summary collapse
- #connect ⇒ Object
- #info ⇒ Object
-
#initialize(token:, user_id:) ⇒ UsersInfo
constructor
A new instance of UsersInfo.
Constructor Details
#initialize(token:, user_id:) ⇒ UsersInfo
Returns a new instance of UsersInfo.
16 17 18 19 |
# File 'lib/slackbot_frd/slack_methods/users_info.rb', line 16 def initialize(token:, user_id:) @token = token @user_id = user_id end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
10 11 12 |
# File 'lib/slackbot_frd/slack_methods/users_info.rb', line 10 def response @response end |
Class Method Details
Instance Method Details
#connect ⇒ Object
21 22 23 24 25 |
# File 'lib/slackbot_frd/slack_methods/users_info.rb', line 21 def connect @response = JSON.parse(self.class.post('', :body => { token: @token, user: @user_id } ).body) ValidateSlack.response(@response) self end |
#info ⇒ Object
27 28 29 |
# File 'lib/slackbot_frd/slack_methods/users_info.rb', line 27 def info @response["user"] end |