Module: ColorMeRad::ColorHelper

Extended by:
ColorHelper
Included in:
ColorHelper
Defined in:
lib/color_me_rad/color_helper.rb

Instance Method Summary collapse

Instance Method Details

#data(data) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/color_me_rad/color_helper.rb', line 5

def data(data)
  return hash(data) if data.is_a?(Hash)
  return array(data) if enumerable?(data)
  return ar_data(data) if active_record?(data)
  return ruby_ivars(data) if ivars?(data)

  colorize_data data
end

#key(data, key) ⇒ Object



14
15
16
17
# File 'lib/color_me_rad/color_helper.rb', line 14

def key(data, key)
  color = ColorMeRad.color_for_key(key)
  add_color data, color
end