class View::Helper
Public Class Methods
new(instance, *list)
click to toggle source
create helper object that cah be used in template render
# File lib/lux/view/helper.rb, line 8 def initialize instance, *list extend ApplicationHelper list.flatten.compact.each do |el| el = el.to_s.classify+'Helper' extend el.constantize end local_vars = instance.class == Hash ? instance : instance.instance_variables_hash # locals overide globals for k, v in local_vars instance_variable_set("@#{k.to_s.sub('@','')}", v) end # helper.instance_exec &block if block end
Public Instance Methods
content(name=nil) { || ... }
click to toggle source
no_white_space() { || ... }
click to toggle source
# File lib/lux/view/helper.rb, line 32 def no_white_space yield.gsub(/>\s+</,'><') end