class LeanTesting::ProjectSectionsHandler

Public Class Methods

new(origin, projectID) click to toggle source
Calls superclass method LeanTesting::EntityHandler::new
# File lib/Handler/Project/ProjectSectionsHandler.rb, line 4
def initialize(origin, projectID)
        super(origin)

        @projectID = projectID
end

Public Instance Methods

all(filters = nil) click to toggle source
Calls superclass method LeanTesting::EntityHandler#all
# File lib/Handler/Project/ProjectSectionsHandler.rb, line 29
def all(filters = nil)
        if !filters
                filters = {}
        end

        super

        request = APIRequest.new(@origin, '/v1/projects/' + @projectID.to_s() + '/sections', 'GET')
        EntityList.new(@origin, request, ProjectSection, filters)
end
create(fields) click to toggle source
Calls superclass method LeanTesting::EntityHandler#create
# File lib/Handler/Project/ProjectSectionsHandler.rb, line 10
def create(fields)
        super

        supports = {
                'name' => true
        }

        if enforce(fields, supports)
                req = APIRequest.new(
                        @origin,
                        '/v1/projects/' + @projectID.to_s() + '/sections',
                        'POST',
                        {'params' => fields}
                )

                ProjectSection.new(@origin, req.exec)
        end
end