Class: Fastly::Client::Curl

Inherits:
Object
  • Object
show all
Defined in:
lib/fastly/client.rb

Overview

:nodoc: all

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, port = 443) ⇒ Curl



118
119
120
121
122
# File 'lib/fastly/client.rb', line 118

def initialize(host, port=443)
    self.host     = host
    self.port     = port
    self.protocol = 'https'
end

Instance Attribute Details

#hostObject

Returns the value of attribute host.



116
117
118
# File 'lib/fastly/client.rb', line 116

def host
  @host
end

#portObject

Returns the value of attribute port.



116
117
118
# File 'lib/fastly/client.rb', line 116

def port
  @port
end

#protocolObject

Returns the value of attribute protocol.



116
117
118
# File 'lib/fastly/client.rb', line 116

def protocol
  @protocol
end

Instance Method Details

#delete(path, headers = {}) ⇒ Object



136
137
138
# File 'lib/fastly/client.rb', line 136

def delete(path, headers={})
    CurbFu.delete({ :host => host, :port => port, :path => path, :headers => headers, :protocol => protocol })
end

#get(path, headers = {}) ⇒ Object



124
125
126
# File 'lib/fastly/client.rb', line 124

def get(path, headers={})
    CurbFu.get({ :host => host, :port => port, :path => path, :headers => headers, :protocol => protocol })
end

#post(path, params, headers = {}) ⇒ Object



128
129
130
# File 'lib/fastly/client.rb', line 128

def post(path, params, headers={})
    CurbFu.post({ :host => host, :port => port, :path => path, :headers => headers, :protocol => protocol }, params)
end

#put(path, params, headers = {}) ⇒ Object



132
133
134
# File 'lib/fastly/client.rb', line 132

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



140
141
142
# File 'lib/fastly/client.rb', line 140

def use_ssl=(ssl)
    self.protocol = ssl ? 'https' : 'http'
end