Class: LucidHttp::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/lucid_http.rb

Instance Method Summary collapse

Constructor Details

#initialize(base_url: ENV.fetch("LUCID_HTTP_BASE_URL")) ⇒ Client

Returns a new instance of Client.



21
22
23
# File 'lib/lucid_http.rb', line 21

def initialize(base_url: ENV.fetch("LUCID_HTTP_BASE_URL"))
  LucidHttp.base_url = base_url
end

Instance Method Details

#base_urlObject



25
26
27
# File 'lib/lucid_http.rb', line 25

def base_url
  LucidHttp.base_url
end

#do_verb(verb:, path:, formatter:, follower:, form:) ⇒ Object



39
40
41
42
43
44
45
# File 'lib/lucid_http.rb', line 39

def do_verb(verb:, path:, formatter:, follower:, form:)
  LucidHttp::Response.new(
    base_url: base_url, path: path, verb: verb,
    formatter: formatter, follower: follower,
    form: form,
  )
end