Class: SlackChatter::Api::Base
- Inherits:
-
Object
- Object
- SlackChatter::Api::Base
- Defined in:
- lib/slack_chatter/api/base.rb
Direct Known Subclasses
Api, Auth, Channels, Chat, Emoji, Files, Groups, Im, Oauth, Rtm, Search, Stars, Team, Users
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #bool_as_i(bool) ⇒ Object
- #call_method(name_space, slack_method, params, http_method = :get) ⇒ Object
- #channel_id_or_name ⇒ Object
-
#initialize(client) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(client) ⇒ Base
Returns a new instance of Base.
6 7 8 |
# File 'lib/slack_chatter/api/base.rb', line 6 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/slack_chatter/api/base.rb', line 4 def client @client end |
Instance Method Details
#bool_as_i(bool) ⇒ Object
23 24 25 |
# File 'lib/slack_chatter/api/base.rb', line 23 def bool_as_i(bool) bool ? 1 : 0 end |
#call_method(name_space, slack_method, params, http_method = :get) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/slack_chatter/api/base.rb', line 14 def call_method(name_space, slack_method, params, http_method=:get) path = "#{name_space}.#{slack_method}" if http_method.to_sym == :get client.get(path, params) else client.post(path, params) end end |
#channel_id_or_name ⇒ Object
10 11 12 |
# File 'lib/slack_chatter/api/base.rb', line 10 def channel_id_or_name end |