Sha256: 8516eaba9e84dfbbad871b1eb7d6c68a6b9df3792e4e26fa70fb5d518fbbcc99

Contents?: true

Size: 361 Bytes

Versions: 5

Compression:

Stored size: 361 Bytes

Contents

module Crystal
  module ControllerExtensions
    def self.included(base)
      base.before_filter :_set_meta
      base.helper_method :meta
    end

    def meta(options = {})
      options.present? && @_meta.store(options)
      @_meta
    end

    protected

    def _set_meta
      @_meta = Meta.new(OptionsForController.new(self).options)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
crystalmeta-0.9.4 lib/crystal/controller_extensions.rb
crystalmeta-0.9.3 lib/crystal/controller_extensions.rb
crystalmeta-0.9.2 lib/crystal/controller_extensions.rb
crystalmeta-0.9.1 lib/crystal/controller_extensions.rb
crystalmeta-0.9.0 lib/crystal/controller_extensions.rb