Sha256: 15748281f9c865f0db8b3f70dad13f1d8d9380253fae47b8efd93b1ae94dda26

Contents?: true

Size: 805 Bytes

Versions: 48

Compression:

Stored size: 805 Bytes

Contents

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

        def name(name)
          set :name, name
        end

        def description(description)
          set :description, description
        end

        def text(text)
          set :text, text
        end

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

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
portatext-1.5.5 lib/portatext/command/api/templates.rb
portatext-1.5.4 lib/portatext/command/api/templates.rb
portatext-1.5.3 lib/portatext/command/api/templates.rb
portatext-1.5.2 lib/portatext/command/api/templates.rb
portatext-1.5.1 lib/portatext/command/api/templates.rb
portatext-1.5.0 lib/portatext/command/api/templates.rb
portatext-1.4.4 lib/portatext/command/api/templates.rb
portatext-1.4.3 lib/portatext/command/api/templates.rb
portatext-1.4.2 lib/portatext/command/api/templates.rb
portatext-1.4.1 lib/portatext/command/api/templates.rb
portatext-1.4.0 lib/portatext/command/api/templates.rb
portatext-1.3.1 lib/portatext/command/api/templates.rb
portatext-1.3.0 lib/portatext/command/api/templates.rb
portatext-1.2.0 lib/portatext/command/api/templates.rb
portatext-1.1.11 lib/portatext/command/api/templates.rb
portatext-1.1.10 lib/portatext/command/api/templates.rb
portatext-1.1.9 lib/portatext/command/api/templates.rb
portatext-1.1.8 lib/portatext/command/api/templates.rb
portatext-1.1.7 lib/portatext/command/api/templates.rb
portatext-1.1.6 lib/portatext/command/api/templates.rb