Module: Misty::HTTP::Direct
- Included in:
- Client
- Defined in:
- lib/misty/http/direct.rb
Overview
Provides methods to submit the current service with a path and override @base_path if needed
Instance Method Summary collapse
- #base_set(base_path) ⇒ Object
- #delete(path, base_path = nil) ⇒ Object
- #get(path, base_path = nil) ⇒ Object
- #post(path, data, base_path = nil) ⇒ Object
- #put(path, data, base_path = nil) ⇒ Object
Instance Method Details
#base_set(base_path) ⇒ Object
5 6 7 |
# File 'lib/misty/http/direct.rb', line 5 def base_set(base_path) base = base_path ? base_path : @base_path end |
#delete(path, base_path = nil) ⇒ Object
9 10 11 |
# File 'lib/misty/http/direct.rb', line 9 def delete(path, base_path = nil) http_delete(base_set(base_path) + path, headers) end |
#get(path, base_path = nil) ⇒ Object
13 14 15 |
# File 'lib/misty/http/direct.rb', line 13 def get(path, base_path = nil) http_get(base_set(base_path) + path, headers) end |
#post(path, data, base_path = nil) ⇒ Object
17 18 19 |
# File 'lib/misty/http/direct.rb', line 17 def post(path, data, base_path = nil) http_post(base_set(base_path) + path, headers, data) end |
#put(path, data, base_path = nil) ⇒ Object
21 22 23 |
# File 'lib/misty/http/direct.rb', line 21 def put(path, data, base_path = nil) http_put(base_set(base_path) + path, headers, data) end |