Class: Forward::API::Tunnel
- Defined in:
- lib/forward/api/tunnel.rb
Constant Summary
Constants inherited from Resource
Resource::DEFAULT_ERROR_MESSAGE
Constants included from Common
Instance Attribute Summary
Attributes inherited from Resource
Class Method Summary collapse
Methods inherited from Resource
#add_body!, #add_head!, #delete, #get, #initialize, #post, #request
Methods included from Common
#config, #exit_with_error, #exit_with_message, #logged_in?, #logger, #os, #stop_reactor_and_exit, #windows?
Constructor Details
This class inherits a constructor from Forward::API::Resource
Class Method Details
.create(options, &block) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/forward/api/tunnel.rb', line 5 def self.create(, &block) resource = new = { path: "#{API.base_path}/tunnels/", authenticated: true, params: { hostport: [:port], vhost: [:host], subdomain: [:subdomain_prefix], cname: [:cname], username: [:username], password: [:password], no_auth: [:no_auth], client: Forward.client_string, } } resource.post() do |response, status| if status == 200 block.call(response) else handle_error(response, status) end end end |