Lund-Org/cherry

View on GitHub
src/redirections/RedirectionManager.js

Summary

Maintainability
A
0 mins
Test Coverage
const Redirection = require('../redirections/Redirection')

class RedirectionManager {
  constructor () {
    this.redirections = []
  }

  /**
   * Create a Redirection and push it in the redirection pool
   * @param {Object} redirectionPayload The definition of a redirection
   */
  registerRoute (redirectionPayload) {
    this.redirections.push(new Redirection(redirectionPayload))
  }

  /**
   * Getter of the redirections
   * @return {Array} The redirection pool
   */
  getRedirections () {
    return this.redirections
  }
}

module.exports = RedirectionManager