def add_exposed_to_context(context)
      (self.class.exposed_to_template || {}).each do |k, v|
        context.define_singleton_method(k, &method(v))
      end
    end
def add_exposed_to_context(context)
      (self.class.exposed_to_template || {}).each do |k, v|
        context.define_singleton_method(k, &method(v))
      end
    end
Extensions are instantiated when they are activated.
 @param [Middleman::Application] app The Middleman::Application instance
 @param [Hash] options_hash The raw options hash. Subclasses should not manipulate this directly - it will be turned into {#options}.
 @yield An optional block that can be used to customize options before the extension is activated.
 @yieldparam [Middleman::Configuration::ConfigurationManager] options Extension options
 @!method before_configuration
   Respond to the `before_configuration` event.
   If a `before_configuration` method is implemented, that method will be run before `config.rb` is run.
   @note Because most extensions are activated from within `config.rb`, they *will not run* any `before_configuration` hook.
 @!method after_configuration
   Respond to the `after_configuration` event.
   If an `after_configuration` method is implemented, that method will be run before `config.rb` is run.
 @!method before_build
   Respond to the `before_build` event.
   If an `before_build` method is implemented, that method will be run before the builder runs.
 @!method after_build
   Respond to the `after_build` event.
   If an `after_build` method is implemented, that method will be run after the builder runs.
 @!method ready
   Respond to the `ready` event.
   If an `ready` method is implemented, that method will be run after the app has finished booting up.
 @!method manipulate_resource_list(resources)
   Manipulate the resource list by transforming or adding {Sitemap::Resource}s.
   Sitemap manipulation is a powerful way of interacting with a project, since it can modify each {Sitemap::Resource} or generate new {Sitemap::Resources}. This method is used in a pipeline where each sitemap manipulator is run in turn, with each one being fed the output of the previous manipulator. See the source of built-in Middleman extensions like {Middleman::Extensions::DirectoryIndexes} and {Middleman::Extensions::AssetHash} for examples of how to use this.
   @note This method *must* return the full set of resources, because its return value will be used as the new sitemap.
   @see http://middlemanapp.com/advanced/sitemap/ Sitemap Documentation
   @see Sitemap::Store
   @see Sitemap::Resource
   @param [Array<Sitemap::Resource>] resources A list of all the resources known to the sitemap.
   @return [Array<Sitemap::Resource>] The transformed list of resources.