Class: Fastly::Client::Curl
- Inherits:
-
Object
- Object
- Fastly::Client::Curl
- Defined in:
- lib/fastly/client/curl.rb
Overview
:nodoc: all
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#port ⇒ Object
Returns the value of attribute port.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
- #delete(path, headers = {}) ⇒ Object
- #get(path, headers = {}) ⇒ Object
-
#initialize(uri) ⇒ Curl
constructor
A new instance of Curl.
- #post(path, params, headers = {}) ⇒ Object
- #put(path, params, headers = {}) ⇒ Object
Constructor Details
#initialize(uri) ⇒ Curl
Returns a new instance of Curl.
9 10 11 12 13 14 |
# File 'lib/fastly/client/curl.rb', line 9 def initialize(uri) @uri = uri @host = uri.host @port = uri.port @protocol = uri.scheme end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
7 8 9 |
# File 'lib/fastly/client/curl.rb', line 7 def host @host end |
#port ⇒ Object
Returns the value of attribute port.
7 8 9 |
# File 'lib/fastly/client/curl.rb', line 7 def port @port end |
#protocol ⇒ Object
Returns the value of attribute protocol.
7 8 9 |
# File 'lib/fastly/client/curl.rb', line 7 def protocol @protocol end |
#uri ⇒ Object
Returns the value of attribute uri.
7 8 9 |
# File 'lib/fastly/client/curl.rb', line 7 def uri @uri end |
Instance Method Details
#delete(path, headers = {}) ⇒ Object
46 47 48 49 50 51 52 53 54 |
# File 'lib/fastly/client/curl.rb', line 46 def delete(path, headers = {}) CurbFu.delete({ host: host, port: port, path: path, headers: headers, protocol: protocol }) end |
#get(path, headers = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/fastly/client/curl.rb', line 16 def get(path, headers = {}) CurbFu.get({ host: host, port: port, path: path, headers: headers, protocol: protocol }) end |
#post(path, params, headers = {}) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/fastly/client/curl.rb', line 26 def post(path, params, headers = {}) CurbFu.post({ host: host, port: port, path: path, headers: headers, protocol: protocol }, params) end |
#put(path, params, headers = {}) ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/fastly/client/curl.rb', line 36 def put(path, params, headers = {}) CurbFu.put({ host: host, port: port, path: path, headers: headers, protocol: protocol }, params) end |