class AfTalk::Request

Public Class Methods

get(path, **options) click to toggle source
# File lib/aftalk/request.rb, line 3
def self.get(path, **options)
  new.get(path, options)
end
post(path, **options) click to toggle source
# File lib/aftalk/request.rb, line 7
def self.post(path, **options)
  new.post(path, options)
end

Public Instance Methods

get(path, **options) click to toggle source
# File lib/aftalk/request.rb, line 11
def get(path, **options)
  connection.get(complete_path(path), complete_options(options))
end
post(path, **options) click to toggle source
# File lib/aftalk/request.rb, line 15
def post(path, **options)
  connection.post(complete_path(path), complete_options(options))
end

Private Instance Methods

complete_options(options) click to toggle source
# File lib/aftalk/request.rb, line 21
def complete_options(options)
  default_options.merge(options)
end
complete_path(path) click to toggle source
# File lib/aftalk/request.rb, line 25
def complete_path(path)
  "/#{configuration.version}#{path}"
end
configuration() click to toggle source
# File lib/aftalk/request.rb, line 29
def configuration
  AfTalk::Configuration
end
connection() click to toggle source
# File lib/aftalk/request.rb, line 33
def connection
  AfTalk::Connection.build
end
default_options() click to toggle source
# File lib/aftalk/request.rb, line 37
def default_options
  { username: configuration.user_name }
end