class CabezaDeTermo::Assets::HanamiRenderingScope

This class is a wrapper on a Hanami::Views::LayoutScope object to delegate the :collect_stylesheets_with and :collect_javascripts_with to the actual layout_scope.

Public Class Methods

each_javascript_from(layout_scope, &block) click to toggle source

Collect the javascripts from the layout_scope and iterate over each javascript

# File lib/cabeza-de-termo/assets/rendering-scope-adaptors/hanami-rendering-scope.rb, line 29
def self.each_javascript_from(layout_scope, &block)
        javascripts_from(layout_scope).each(&block)
end
each_stylesheet_from(layout_scope, &block) click to toggle source

Collect the stylesheets from the layout_scope and iterate over each stylesheet

# File lib/cabeza-de-termo/assets/rendering-scope-adaptors/hanami-rendering-scope.rb, line 24
def self.each_stylesheet_from(layout_scope, &block)
        stylesheets_from(layout_scope).each(&block)
end
javascripts_from(layout_scope) click to toggle source

Collect the javascripts from the layout_scope

# File lib/cabeza-de-termo/assets/rendering-scope-adaptors/hanami-rendering-scope.rb, line 19
def self.javascripts_from(layout_scope)
        Library.javascripts_for (self.on layout_scope)
end
new(layout_scope) click to toggle source

Instance methods

# File lib/cabeza-de-termo/assets/rendering-scope-adaptors/hanami-rendering-scope.rb, line 35
def initialize(layout_scope)
        @layout_scope = layout_scope
end
on(layout_scope) click to toggle source

Answer a new adaptor on the layout_scope

# File lib/cabeza-de-termo/assets/rendering-scope-adaptors/hanami-rendering-scope.rb, line 9
def self.on(layout_scope)
        new(layout_scope)
end
stylesheets_from(layout_scope) click to toggle source

Collect the stylesheets from the layout_scope

# File lib/cabeza-de-termo/assets/rendering-scope-adaptors/hanami-rendering-scope.rb, line 14
def self.stylesheets_from(layout_scope)
        Library.stylesheets_for (self.on layout_scope)
end

Public Instance Methods

collect_javascripts_with(assets_collector) click to toggle source

Delegate the :collect_javascripts_with method to the actual Hanami::LayoutScope

# File lib/cabeza-de-termo/assets/rendering-scope-adaptors/hanami-rendering-scope.rb, line 46
def collect_javascripts_with(assets_collector)
        collect_javascripts_from_layout_with assets_collector
        collect_javascripts_from_view_with assets_collector
end
collect_stylesheets_with(assets_collector) click to toggle source

Delegate the :collect_stylesheets_with method to the actual Hanami::LayoutScope

# File lib/cabeza-de-termo/assets/rendering-scope-adaptors/hanami-rendering-scope.rb, line 40
def collect_stylesheets_with(assets_collector)
        collect_stylesheets_from_layout_with assets_collector
        collect_stylesheets_from_view_with assets_collector
end

Protected Instance Methods

collect_javascripts_from_layout_with(assets_collector) click to toggle source

Collect the javascripts from the layout on the @layout_scope, if present.

# File lib/cabeza-de-termo/assets/rendering-scope-adaptors/hanami-rendering-scope.rb, line 65
def collect_javascripts_from_layout_with(assets_collector)
        return unless @layout_scope.respond_to?(:layout_javascripts)
        @layout_scope.layout_javascripts assets_collector
end
collect_javascripts_from_view_with(assets_collector) click to toggle source

Collect the javascripts from the view on the @layout_scope, if present.

# File lib/cabeza-de-termo/assets/rendering-scope-adaptors/hanami-rendering-scope.rb, line 71
def collect_javascripts_from_view_with(assets_collector)
        return unless @layout_scope.respond_to?(:view_javascripts)
        @layout_scope.view_javascripts assets_collector
end
collect_stylesheets_from_layout_with(assets_collector) click to toggle source

Collect the stylesheets from the layout on the @layout_scope, if present.

# File lib/cabeza-de-termo/assets/rendering-scope-adaptors/hanami-rendering-scope.rb, line 53
def collect_stylesheets_from_layout_with(assets_collector)
        return unless @layout_scope.respond_to?(:layout_stylesheets)
        @layout_scope.layout_stylesheets assets_collector
end
collect_stylesheets_from_view_with(assets_collector) click to toggle source

Collect the stylesheets from the view on the @layout_scope, if present.

# File lib/cabeza-de-termo/assets/rendering-scope-adaptors/hanami-rendering-scope.rb, line 59
def collect_stylesheets_from_view_with(assets_collector)
        return unless @layout_scope.respond_to?(:view_stylesheets)
        @layout_scope.view_stylesheets assets_collector
end