All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hyperscala.web.site.SessionContextualizable.scala Maven / Gradle / Ivy

There is a newer version: 0.9.0
Show newest version
package org.hyperscala.web.site

import language.reflectiveCalls

/**
 * SessionContextualizable allows easy ability to iterate over and communicate to all instances of a specific
 * Webpage type.
 *
 * @author Matt Hicks 
 */
class SessionContextualizable[T <: Webpage](implicit manifest: Manifest[T]) {
  def contextualize(f: T => Unit) = {
    Website().sessions.valuesByType[T](manifest).foreach {
      case page => {
        page.context {
          f(page)
        }
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy