Class: Fidelity::WidgetHelper

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers
Defined in:
lib/fidelity/widget_helper.rb

Instance Method Summary collapse

Instance Method Details

#class_name_if?(test = nil, name = 'active') ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/fidelity/widget_helper.rb', line 13

def class_name_if? test=nil, name='active'
  test ? name : ''
end

#select_first(*arguments) ⇒ Object



5
6
7
# File 'lib/fidelity/widget_helper.rb', line 5

def select_first *arguments
  arguments.compact.first
end

#to_class_name(*arguments) ⇒ Object



9
10
11
# File 'lib/fidelity/widget_helper.rb', line 9

def to_class_name *arguments
  arguments.compact.map(&:to_s).join(' ')
end