Module: BestInPlaceish::DisplayMethods

Extended by:
DisplayMethods
Included in:
DisplayMethods
Defined in:
lib/best_in_placeish/display_methods.rb

Constant Summary collapse

@@table =
Hash.new { |h,k| h[k] = Hash.new(&h.default_proc) }

Instance Method Summary collapse

Instance Method Details

#add(klass, attr, display_as) ⇒ Object



12
13
14
# File 'lib/best_in_placeish/display_methods.rb', line 12

def add(klass, attr, display_as)
  @@table[klass.to_s][attr.to_s] = display_as.to_sym
end

#lookup(klass, attr) ⇒ Object



7
8
9
10
# File 'lib/best_in_placeish/display_methods.rb', line 7

def lookup(klass, attr)
  foo = @@table[klass.to_s][attr.to_s]
  foo == {} ? nil : foo
end