Sha256: b689e3a6a2fcc83182cb0542612b191f51debceaceb3aea5a22f4aac016d2c3e

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 = {})
        get "#{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.7 lib/voog_api/api/contents.rb