Sha256: 34541b6298f8055af0fa32eaad55433a924541a21afc35309c118c5028bb7379

Contents?: true

Size: 702 Bytes

Versions: 16

Compression:

Stored size: 702 Bytes

Contents

module PortaText
  module Command
    module Api
      # The me/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)
          'me/acl'
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
portatext-1.2.0 lib/portatext/command/api/acl.rb
portatext-1.1.11 lib/portatext/command/api/acl.rb
portatext-1.1.10 lib/portatext/command/api/acl.rb
portatext-1.1.9 lib/portatext/command/api/acl.rb
portatext-1.1.8 lib/portatext/command/api/acl.rb
portatext-1.1.7 lib/portatext/command/api/acl.rb
portatext-1.1.6 lib/portatext/command/api/acl.rb
portatext-1.1.5 lib/portatext/command/api/acl.rb
portatext-1.1.4 lib/portatext/command/api/acl.rb
portatext-1.1.3 lib/portatext/command/api/acl.rb
portatext-1.1.2 lib/portatext/command/api/acl.rb
portatext-1.1.1 lib/portatext/command/api/acl.rb
portatext-1.1.0 lib/portatext/command/api/acl.rb
portatext-1.0.0 lib/portatext/command/api/acl.rb
portatext-1.0.0.pre lib/portatext/command/api/acl.rb
portatext-0.0.2 lib/portatext/command/api/acl.rb