class Slack::API::Base

Constants

URL_TEMPLATE

Attributes

default_args[R]

Public Class Methods

new(default_args = {}) click to toggle source
# File lib/slack/api/base.rb, line 9
def initialize(default_args = {})
  @default_args = default_args
end

Public Instance Methods

get(endpoint, args = {}) click to toggle source
# File lib/slack/api/base.rb, line 13
def get(endpoint, args = {})
  Faraday.get(api_url(endpoint, default_args.merge(args))).body
end

Private Instance Methods

api_url(endpoint, args = {}) click to toggle source
# File lib/slack/api/base.rb, line 22
def api_url(endpoint, args = {})
  URL_TEMPLATE.expand(endpoint: endpoint, args: args)
end