class Sitejabber::Request

Attributes

raw_options[R]
raw_params[R]
raw_path[R]
raw_verb[R]

Public Class Methods

new(path, params: {}) click to toggle source
# File lib/sitejabber/request.rb, line 5
def initialize path, params: {}, options: {}, verb: "get"
  @raw_params = params
  @raw_options = options
  @raw_path = path
  @raw_verb = verb
end

Public Instance Methods

base_url() click to toggle source
# File lib/sitejabber/request.rb, line 16
def base_url
  Sitejabber.api_url
end
headers() click to toggle source
# File lib/sitejabber/request.rb, line 20
def headers
  {
    "Content-Type": "application/json",
  }.merge( raw_options[ :headers ] || {})
end
options() click to toggle source
# File lib/sitejabber/request.rb, line 26
def options
  raw_options

  # TODO: verify certificate
  # raw_options.merge(
  #   use_ssl: true,
  #   ssl: { verify: true }.merge( raw_options[ :ssl ] || {} ),
  # )
end
params() click to toggle source
# File lib/sitejabber/request.rb, line 12
def params
  raw_params
end
path() click to toggle source
# File lib/sitejabber/request.rb, line 36
def path
  raw_path
end
verb() click to toggle source
# File lib/sitejabber/request.rb, line 40
def verb
  raw_verb
end