Sha256: 86a5a338d0a466f5ac9a449f222390ab86fd98b44ac5697e8c83eb10fd13785b

Contents?: true

Size: 1.27 KB

Versions: 7

Compression:

Stored size: 1.27 KB

Contents

# encoding: utf-8

module Nimbu
  module Endpoints
    class Channels::Entries < Endpoint

      def list(*args)
        arguments(args, :required => [:channel_id])

        response = get_request("/channels/#{channel_id}/entries", arguments.params)

        if block_given?
          response.each { |el| yield el }
        else
          return response
        end
      end
      alias :all :list

      def get(*args)
        arguments(args, :required => [:channel_id, :entry_id])

        get_request("/channels/#{channel_id}/entries/#{entry_id}", arguments.params)
      end
      alias :find :get

      def create(*args)
        arguments(args, :required => [:channel_id])

        post_request("/channels/#{channel_id}/entries", arguments.params, :with_attachments => true)
      end

      def update(*args)
        arguments(args, :required => [:channel_id, :entry_id])

        patch_request("/channels/#{channel_id}/entries/#{entry_id}", arguments.params, :with_attachments => true)
      end
      alias :edit :update

      def delete(*args)
        arguments(args, :required => [:channel_id, :entry_id])

        delete_request("/channels/#{channel_id}/entries/#{entry_id}", arguments.params)
      end
      alias :remove :delete


    end # Authorizations
  end # Endpoints
end # Nimbu

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
nimbu-api-0.1.5 lib/nimbu-api/endpoints/channels/entries.rb
nimbu-api-0.1.4 lib/nimbu-api/endpoints/channels/entries.rb
nimbu-api-0.1.3 lib/nimbu-api/endpoints/channels/entries.rb
nimbu-api-0.1.1 lib/nimbu-api/endpoints/channels/entries.rb
nimbu-api-0.1 lib/nimbu-api/endpoints/channels/entries.rb
nimbu-api-0.0.2 lib/nimbu-api/endpoints/channels/entries.rb
nimbu-api-0.0.1 lib/nimbu-api/endpoints/channels/entries.rb