require 'delegate'
require 'end_view'
require 'haml'
require 'tilt/haml'

module EndView
  class RailsLayout < SimpleDelegator
    include EndView.new(__FILE__, Tilt::HamlTemplate)

    def initialize(view_context, title)
      super(view_context)
      @title = title
    end

    private

    def stylesheet_link_tag
      super('application', media: 'all', 'data-turbolinks-track' => true )
    end

    def javascript_include_tag
      super('application', 'data-turbolinks-track' => true )
    end
  end
end

__END__

!!! 5
%html
  %head
    %title= @title
    = stylesheet_link_tag
    = javascript_include_tag
    = csrf_meta_tags
  %body= yield
require 'delegate'
require 'end_view'
require 'haml'
require 'tilt/haml'

module EndView
  class RailsLayout < SimpleDelegator
    include EndView.new(__FILE__, Tilt::HamlTemplate)

    def initialize(view_context, title)
      super(view_context)
      @title = title
    end

    private

    def stylesheet_args
      ['application', { media: 'all', 'data-turbolinks-track' => true }]
    end

    def javascript_args
      ['application', { 'data-turbolinks-track' => true }]
    end
  end
end

__END__

!!! 5
%html
  %head
    %title= @title
    = stylesheet_link_tag(*stylesheet_args)
    = javascript_include_tag(*javascript_args)
    = csrf_meta_tags
  %body= yield
--- 
+++ 
@@ -14,12 +14,12 @@
 
     private
 
-    def stylesheet_args
-      ['application', { media: 'all', 'data-turbolinks-track' => true }]
+    def stylesheet_link_tag
+      super('application', media: 'all', 'data-turbolinks-track' => true )
     end
 
-    def javascript_args
-      ['application', { 'data-turbolinks-track' => true }]
+    def javascript_include_tag
+      super('application', 'data-turbolinks-track' => true )
     end
   end
 end
@@ -30,7 +30,7 @@
 %html
   %head
     %title= @title
-    = stylesheet_link_tag(*stylesheet_args)
-    = javascript_include_tag(*javascript_args)
+    = stylesheet_link_tag
+    = javascript_include_tag
     = csrf_meta_tags
   %body= yield
Use super instead of splat
