Sha256: b47d09082b0ff78df13b182f0500fc57512443c95f31291b917c6446550d36ef

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

module Voog
  class API
    module Contents

      module ParentKind
        Article = 'articles'
        Element = 'elements'
        Language = 'languages'
        Page = 'pages'
      end

      # List contents
      def contents(parent_name, parent_id, params = {})
        paginate "#{parent_name}/#{parent_id}/contents", {query: params}
      end

      # Get a single content
      def content(parent_name, parent_id, id, params = {})
        get "#{parent_name}/#{parent_id}/contents/#{id}", {query: params}
      end

      # Create a content
      def create_content(parent_name, parent_id, data)
        post "#{parent_name}/#{parent_id}/contents", data
      end

      # Delete a content
      def delete_content(parent_name, parent_id, id)
        delete "#{parent_name}/#{parent_id}/contents/#{id}"
      end

      # Reorder/move content inside/between content areas and parent objects
      def move_content(parent_name, parent_id, id, params = {})
        put "#{parent_name}/#{parent_id}/contents/#{id}/move", nil, {query: params}
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
voog_api-0.0.10 lib/voog_api/api/contents.rb