Sha256: 64653e594e8289a9867d2949100a3b22127f845cfb7f60592a0f3fe4ea725089

Contents?: true

Size: 773 Bytes

Versions: 5

Compression:

Stored size: 773 Bytes

Contents

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

        def csv(file)
          set :file, file
        end

        def endpoint(_method)
          error = @args[:number].nil? && @args[:file].nil?
          raise 'DID number cant be null' if error
          number = @args[:number]
          @args.delete :number
          return "cnam/#{number}" unless number.nil?
          'cnam'
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
portatext-1.6.1 lib/portatext/command/api/cnam.rb
portatext-1.6.0 lib/portatext/command/api/cnam.rb
portatext-1.5.23 lib/portatext/command/api/cnam.rb
portatext-1.5.22 lib/portatext/command/api/cnam.rb
portatext-1.5.21 lib/portatext/command/api/cnam.rb