Sha256: bfe9d460d9af57a3e5fb10fdc427bdf3cc73f22af0bc4d8b08c8d8b3ee242bee

Contents?: true

Size: 884 Bytes

Versions: 1

Compression:

Stored size: 884 Bytes

Contents

# encoding: utf-8
# frozen_string_literal: true

module Nimbu
  module Endpoints
    class Themes::Snippets < Endpoint
      def create(*args)
        arguments(args, required: [:theme_id])

        forced = arguments.params.delete("force")
        query_params = {}
        query_params = { force: forced } unless forced.nil?

        post_request("/themes/#{theme_id}/snippets", arguments.params, params: query_params)
      end

      def get(*args)
        arguments(args, required: [:theme_id, :snippet_id])

        get_request("/themes/#{theme_id}/snippets/#{snippet_id}", arguments.params)
      end

      def delete(*args)
        arguments(args, required: [:theme_id, :snippet_id])

        delete_request("/themes/#{theme_id}/snippets/#{snippet_id}", arguments.params)
      end
      alias_method :remove, :delete
    end # Themes::Snippets
  end # Endpoints
end # Nimbu

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nimbu-api-0.5.0 lib/nimbu-api/endpoints/themes/snippets.rb