Sha256: 5f9a832fc30fd490f8a3a0bc9409987f7856626f7f2ff894e87d08e461737aa7

Contents?: true

Size: 696 Bytes

Versions: 33

Compression:

Stored size: 696 Bytes

Contents

module PortaText
  module Command
    module Api
      # The acl endpoint.
      # https://github.com/PortaText/docs/wiki/REST-API#api_acl
      #
      # Author::    Marcelo Gornstein (mailto:marcelog@portatext.com)
      # Copyright:: Copyright (c) 2015 PortaText
      # License::   Apache-2.0
      class Acl < Base
        def add(ip, netmask = 32, description = '')
          key = "#{ip}#{netmask}"
          set key, ip: ip, netmask: netmask, description: description
        end

        def body(method)
          return super if method.eql? :get
          { acl: @args.values }.to_json
        end

        def endpoint(_method)
          'acl'
        end
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
portatext-1.6.1 lib/portatext/command/api/acl.rb
portatext-1.6.0 lib/portatext/command/api/acl.rb
portatext-1.5.23 lib/portatext/command/api/acl.rb
portatext-1.5.22 lib/portatext/command/api/acl.rb
portatext-1.5.21 lib/portatext/command/api/acl.rb
portatext-1.5.20 lib/portatext/command/api/acl.rb
portatext-1.5.19 lib/portatext/command/api/acl.rb
portatext-1.5.18 lib/portatext/command/api/acl.rb
portatext-1.5.17 lib/portatext/command/api/acl.rb
portatext-1.5.16 lib/portatext/command/api/acl.rb
portatext-1.5.15 lib/portatext/command/api/acl.rb
portatext-1.5.14 lib/portatext/command/api/acl.rb
portatext-1.5.13 lib/portatext/command/api/acl.rb
portatext-1.5.12 lib/portatext/command/api/acl.rb
portatext-1.5.11 lib/portatext/command/api/acl.rb
portatext-1.5.10 lib/portatext/command/api/acl.rb
portatext-1.5.9 lib/portatext/command/api/acl.rb
portatext-1.5.8 lib/portatext/command/api/acl.rb
portatext-1.5.7 lib/portatext/command/api/acl.rb
portatext-1.5.6 lib/portatext/command/api/acl.rb