Class: Fastly::Client::Curl
- Inherits:
-
Object
- Object
- Fastly::Client::Curl
- Defined in:
- lib/fastly/client.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.
Instance Method Summary collapse
- #delete(path, headers = {}) ⇒ Object
- #get(path, headers = {}) ⇒ Object
-
#initialize(host, port = 443) ⇒ Curl
constructor
A new instance of Curl.
- #post(path, params, headers = {}) ⇒ Object
- #put(path, params, headers = {}) ⇒ Object
- #use_ssl=(ssl) ⇒ Object
Constructor Details
#initialize(host, port = 443) ⇒ Curl
Returns a new instance of Curl.
133 134 135 136 137 |
# File 'lib/fastly/client.rb', line 133 def initialize(host, port=443) self.host = host self.port = port self.protocol = 'https' end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
131 132 133 |
# File 'lib/fastly/client.rb', line 131 def host @host end |
#port ⇒ Object
Returns the value of attribute port.
131 132 133 |
# File 'lib/fastly/client.rb', line 131 def port @port end |
#protocol ⇒ Object
Returns the value of attribute protocol.
131 132 133 |
# File 'lib/fastly/client.rb', line 131 def protocol @protocol end |
Instance Method Details
#delete(path, headers = {}) ⇒ Object
151 152 153 |
# File 'lib/fastly/client.rb', line 151 def delete(path, headers={}) CurbFu.delete({ :host => host, :port => port, :path => path, :headers => headers, :protocol => protocol }) end |
#get(path, headers = {}) ⇒ Object
139 140 141 |
# File 'lib/fastly/client.rb', line 139 def get(path, headers={}) CurbFu.get({ :host => host, :port => port, :path => path, :headers => headers, :protocol => protocol }) end |
#post(path, params, headers = {}) ⇒ Object
143 144 145 |
# File 'lib/fastly/client.rb', line 143 def post(path, params, headers={}) CurbFu.post({ :host => host, :port => port, :path => path, :headers => headers, :protocol => protocol }, params) end |
#put(path, params, headers = {}) ⇒ Object
147 148 149 |
# File 'lib/fastly/client.rb', line 147 def put(path, params, headers={}) CurbFu.put({ :host => host, :port => port, :path => path, :headers => headers, :params => params, :protocol => protocol }, params) end |
#use_ssl=(ssl) ⇒ Object
155 156 157 |
# File 'lib/fastly/client.rb', line 155 def use_ssl=(ssl) self.protocol = ssl ? 'https' : 'http' end |