class Telegraphist::Client

Attributes

authentication_token[R]
options[R]

Public Class Methods

new(authentication_token) click to toggle source
# File lib/telegraphist/client.rb, line 8
def initialize(authentication_token)
  @authentication_token = authentication_token
  @options = {}
end

Public Instance Methods

get(path, payload={}) click to toggle source
# File lib/telegraphist/client.rb, line 13
def get(path, payload={})
  self.class.get(url(path), options.deep_merge(payload)).parsed_response
end
post(path, payload={}) click to toggle source
# File lib/telegraphist/client.rb, line 17
def post(path, payload={})
  self.class.post(url(path), options.deep_merge(payload)).parsed_response
end
url(path) click to toggle source
# File lib/telegraphist/client.rb, line 21
def url(path)
  ['/', 'bot', authentication_token, '/', path].join
end