Skip to content
Browse files

privatized current_tab method of Tab class

  • Loading branch information...
1 parent 7f0ca88 commit 534a2d2d4f2defefd629a10f337bd88488cd0ae2 @bjeanes bjeanes committed Aug 8, 2008
Showing with 6 additions and 5 deletions.
  1. +5 −4 lib/tab.rb
  2. +1 −1 lib/tab_fu.rb
View
9 lib/tab.rb
@@ -4,15 +4,16 @@ def initialize(context, list_id = '__default')
@context = context
@list_id = list_id.to_s
end
-
- def current_tab
- @context.instance_variable_get('@__current_tab')[@list_id]
- end
def method_missing(tab, name, options = {})
active_class = (tab.to_s == current_tab.to_s) ? " active" : ""
text = active_class.blank? ? @context.link_to(name, options) : name
"<li class=\"#{tab}#{active_class}\"><span><span>#{text}</span></span></li>"
end
+
+ private
+ def current_tab
+ @context.instance_variable_get('@__current_tab')[@list_id]
+ end
end
end
View
2 lib/tab_fu.rb
@@ -6,7 +6,7 @@ def self.included(klass)
klass.module_eval do
# if passing more than one tab, must be explicit with {}
- # these should be merged...
+ # these arguments should be merged... somehow...
def self.tab(name, opts = {})
before_filter(opts) do |c|
c.send :tab, *name

0 comments on commit 534a2d2

Please sign in to comment.
Something went wrong with that request. Please try again.