Sha256: 19e65088ac55312540424e6cc1d920eec9cf193d69481d2d9c9b40a58cf263d2

Contents?: true

Size: 751 Bytes

Versions: 4

Compression:

Stored size: 751 Bytes

Contents

module PortaText
  module Command
    module Api
      # The blacklist endpoint.
      # https://github.com/PortaText/docs/wiki/REST-API#api_blacklist
      #
      # Author::    Marcelo Gornstein (mailto:marcelog@portatext.com)
      # Copyright:: Copyright (c) 2015 PortaText
      # License::   Apache-2.0
      class Blacklist < Base
        def number(number)
          set :number, number
        end

        def csv(file)
          set :file, file
        end

        def endpoint(_method)
          return 'blacklist/contacts' unless @args[:file].nil?
          return 'blacklist' if @args[:number].nil?
          number = @args[:number]
          @args.delete :number
          "blacklist/#{number}"
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
portatext-1.1.1 lib/portatext/command/api/blacklist.rb
portatext-1.1.0 lib/portatext/command/api/blacklist.rb
portatext-1.0.0 lib/portatext/command/api/blacklist.rb
portatext-1.0.0.pre lib/portatext/command/api/blacklist.rb