Sha256: d183132527d6d8a027665a678825345268a46e28a43428737cff84aa9cd39abd

Contents?: true

Size: 775 Bytes

Versions: 13

Compression:

Stored size: 775 Bytes

Contents

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

        def page(page)
          set :page, page
        end

        def endpoint(_method)
          page = @args[:page]
          @args.delete :page
          endpoint = 'jobs'
          endpoint = "jobs?page=#{page}" unless page.nil?
          return endpoint if @args[:id].nil?
          id = @args[:id]
          @args.delete :id
          "jobs/#{id}"
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
portatext-1.5.2 lib/portatext/command/api/jobs.rb
portatext-1.5.1 lib/portatext/command/api/jobs.rb
portatext-1.5.0 lib/portatext/command/api/jobs.rb
portatext-1.4.4 lib/portatext/command/api/jobs.rb
portatext-1.4.3 lib/portatext/command/api/jobs.rb
portatext-1.4.2 lib/portatext/command/api/jobs.rb
portatext-1.4.1 lib/portatext/command/api/jobs.rb
portatext-1.4.0 lib/portatext/command/api/jobs.rb
portatext-1.3.1 lib/portatext/command/api/jobs.rb
portatext-1.3.0 lib/portatext/command/api/jobs.rb
portatext-1.2.0 lib/portatext/command/api/jobs.rb
portatext-1.1.11 lib/portatext/command/api/jobs.rb
portatext-1.1.10 lib/portatext/command/api/jobs.rb