Module: Facile::Api::HttpMethods
- Defined in:
- lib/facile/api/http_methods.rb
Class Method Summary collapse
Instance Method Summary collapse
- #body(body = nil) ⇒ Object
- #headers(headers = nil) ⇒ Object
- #options(options = nil) ⇒ Object
- #params(params = nil) ⇒ Object
- #url(url = nil) ⇒ Object
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 ( = nil) return defaults[:options] if .nil? defaults[: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 |