Sha256: 5de8855368cff2ca16dda5a7dfdee1afa809a39f83ea0b3ee1ff794754a85ad6

Contents?: true

Size: 1.68 KB

Versions: 1

Compression:

Stored size: 1.68 KB

Contents

module Voog
  class API
    module Elements

      # List elements
      def elements(params = {})
        paginate 'elements', {query: params}
      end

      # Get a single element
      def element(id, params = {})
        get "elements/#{id}", {query: params}
      end

      # Create a element
      def create_element(data)
        post 'elements', data
      end

      # Update a element
      def update_element(id, data)
        put "elements/#{id}", data
      end

      # Delete a element
      def delete_element(id)
        delete "elements/#{id}"
      end

      # Reorder a elements
      def move_element(element_id, params)
        put "elements/#{element_id}/move", nil, {query: params}
      end

      # Element contents

      # List contents for element
      def element_contents(id, params = {})
        contents(Voog::API::Contents::ParentKind::Element, id, params)
      end

      # Get a single content for element
      def element_content(element_id, id, params = {})
        content(Voog::API::Contents::ParentKind::Element, element_id, id, params)
      end

      # Create a element content for element
      def create_element_content(element_id, data)
        create_content(Voog::API::Contents::ParentKind::Element, element_id, data)
      end

      # Delete a content from element
      def delete_element_content(element_id, id)
        delete_content(Voog::API::Contents::ParentKind::Element, element_id, id)
      end

      # Reorder/move element content inside/between content areas and parent objects
      def move_element_content(element_id, id, params = {})
        move_content(Voog::API::Contents::ParentKind::Element, element_id, id, 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/elements.rb