Class: Ichiban::HTMLCompiler::Context

Inherits:
Erubis::Context
  • Object
show all
Includes:
ERB::Util, Erubis::XmlHelper, Ichiban::Helpers, NavHelper
Defined in:
lib/ichiban/html_compiler.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from NavHelper

#nav

Methods included from Ichiban::Helpers

#_limit_options, #capture, #concat, #content_tag, #current_path, #javascript_include_tag, #layout, #link_to, #normalize_path, #partial, #path_with_slashes, #relative_url_root, #stylesheet_link_tag, #tag, #tag_attrs

Constructor Details

#initialize(vars) ⇒ Context

Returns a new instance of Context.



95
96
97
98
99
100
# File 'lib/ichiban/html_compiler.rb', line 95

def initialize(vars)
  super(vars)
  self.class.user_defined_helpers.each do |mod|
    extend(mod)
  end
end

Class Method Details

.add_user_defined_helper(mod) ⇒ Object



85
86
87
88
89
# File 'lib/ichiban/html_compiler.rb', line 85

def self.add_user_defined_helper(mod)
  unless @user_defined_helpers.include?(mod)
    @user_defined_helpers << mod
  end
end

.clear_user_defined_helpersObject



91
92
93
# File 'lib/ichiban/html_compiler.rb', line 91

def self.clear_user_defined_helpers
  @user_defined_helpers = []
end

.user_defined_helpersObject



106
107
108
# File 'lib/ichiban/html_compiler.rb', line 106

def self.user_defined_helpers
  @user_defined_helpers
end

Instance Method Details

#layout_stackObject



102
103
104
# File 'lib/ichiban/html_compiler.rb', line 102

def layout_stack
  @_layout_stack or ['default']
end