Module: Facile::Api::HttpMethods

Defined in:
lib/facile/api/http_methods.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



3
4
5
# File 'lib/facile/api/http_methods.rb', line 3

def self.extended(base)
  base.instance_variable_set(:@defaults, {})
end

Instance Method Details

#body(body = nil) ⇒ Object



13
14
15
16
17
# File 'lib/facile/api/http_methods.rb', line 13

def body(body = nil)
  return defaults[:body] if body.nil?

  defaults[:body] = body
end

#headers(headers = nil) ⇒ Object



19
20
21
22
23
# File 'lib/facile/api/http_methods.rb', line 19

def headers(headers = nil)
  return defaults[:headers] if headers.nil?

  defaults[:headers] = headers
end

#options(options = nil) ⇒ Object



31
32
33
34
35
# File 'lib/facile/api/http_methods.rb', line 31

def options(options = nil)
  return defaults[:options] if options.nil?

  defaults[:options] = options
end

#params(params = nil) ⇒ Object



25
26
27
28
29
# File 'lib/facile/api/http_methods.rb', line 25

def params(params = nil)
  return defaults[:params] if params.nil?

  defaults[:params] = params
end

#url(url = nil) ⇒ Object



7
8
9
10
11
# File 'lib/facile/api/http_methods.rb', line 7

def url(url = nil)
  return defaults[:url] if url.nil?

  defaults[:url] = url
end