module Bl::Requestable

Public Instance Methods

client() click to toggle source
# File lib/bl/requestable.rb, line 5
def client
  BacklogKit::Client.new(
    space_id: @config[:space_id],
    api_key: @config[:api_key]
  )
end
formatter() click to toggle source
# File lib/bl/requestable.rb, line 12
def formatter
  @formatter ||= Formatter.new(format: options[:format])
end
request(method, url, opts = nil) click to toggle source
# File lib/bl/requestable.rb, line 16
def request(method, url, opts = nil)
  case method
  when :get
    client.get(url, opts.to_h)
  when :post
    client.post(url, opts.to_h)
  when :patch
    client.patch(url, opts.to_h)
  when :delete
    client.delete(url, opts.to_h)
  else
    raise 'invalid method error'
  end
rescue => e
  puts e.message
end