Sha256: 181b083f6b9e8da181bf1b79f3abf90d0ef806b32fed501d2a3421734a6eac1c

Contents?: true

Size: 789 Bytes

Versions: 8

Compression:

Stored size: 789 Bytes

Contents

class Apitool::Client::Vpn < Apitool::Client::ApitoolClient

  def index
    get('/vpns') do |response, request, result|
      if response.code == 200
        parse(response)
      else
        nil
      end
    end
  end

  def show(id)
    get("/vpns/#{id}") do |response|
      if response.code == 200
        parse(response)
      else
        nil
      end
    end
  end

  def create(username = nil)
    parameters = {
      vpn: {
        username: username
      }
    }
    post("/vpns", parameters) do |response|
      if response.code == 200
        parse(response)
      else
        nil
      end
    end
  end

  def destroy(id)
    delete("/vpns/#{id}") do |response|
      if response.code == 200
        parse(response)
      else
        nil
      end
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
apitool-client-0.0.8 lib/apitool/client/vpn.rb
apitool-client-0.0.7 lib/apitool/client/vpn.rb
apitool-client-0.0.6 lib/apitool/client/vpn.rb
apitool-client-0.0.5 lib/apitool/client/vpn.rb
apitool-client-0.0.4 lib/apitool/client/vpn.rb
apitool-client-0.0.3 lib/apitool/client/vpn.rb
apitool-client-0.0.2 lib/apitool/client/vpn.rb
apitool-client-0.0.1 lib/apitool/client/vpn.rb