Sha256: a9d8510f9a24b18f96f0ad7891a4e74d6d1cae020303db24152dbadbc41bb383

Contents?: true

Size: 444 Bytes

Versions: 14

Compression:

Stored size: 444 Bytes

Contents

module Cell
  # Set the layout per cell class. This is used in #render calls. Gets inherited to subclasses.
  module Layout
    def self.included(base)
      base.extend ClassMethods
      base.inheritable_attr :layout_name
    end

    module ClassMethods
      def layout(name)
        self.layout_name = name
      end
    end

    def process_options!(options)
      options[:layout] ||= self.class.layout_name
      super
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
cells-4.0.5 lib/cell/layout.rb
cells-4.0.4 lib/cell/layout.rb
cells-4.0.3 lib/cell/layout.rb
cells-4.0.2 lib/cell/layout.rb
cells-4.0.1 lib/cell/layout.rb
cells-4.0.0 lib/cell/layout.rb
cells-4.0.0.rc1 lib/cell/layout.rb
cells-4.0.0.beta6 lib/cell/layout.rb
cells-4.0.0.beta5 lib/cell/layout.rb
cells-4.0.0.beta4 lib/cell/layout.rb
cells-4.0.0.beta3 lib/cell/layout.rb
cells-4.0.0.beta2 lib/cell/layout.rb
cells-4.0.0.beta1 lib/cell/layout.rb
cells-jamie-4.0.0.alpha1 lib/cell/layout.rb