Module: Phlexi::Field::Support::Value

Defined in:
lib/phlexi/field/support/value.rb

Class Method Summary collapse

Class Method Details

.from(object, key) ⇒ Object



5
6
7
8
# File 'lib/phlexi/field/support/value.rb', line 5

def self.from(object, key)
  return object[key] if object.is_a?(Hash)
  object.public_send(key) if object.respond_to?(key)
end