Module: WGHashExtensions::ClassMethods

Defined in:
lib/wice_grid_core_ext.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#make_hash(key, value) ⇒ Object

Used mostly for submitting options to view helpers, that is, like this:

(:th, col_link, Hash.make_hash(:class, css_class))

In some it is important that if the value is empty, no option is submitted at all. Thus, there’s a check for an empty value



84
85
86
# File 'lib/wice_grid_core_ext.rb', line 84

def make_hash(key, value) #:nodoc:
  value.blank? ? {} : {key => value}
end