Class: Enumpath::Resolver::Property
- Inherits:
-
Object
- Object
- Enumpath::Resolver::Property
- Defined in:
- lib/enumpath/resolver/property.rb
Overview
A utility for resolving a string as a property of an object
Class Method Summary collapse
-
.resolve(property, object) ⇒ Object
Attempts to resolve a string as a property of an object.
Class Method Details
.resolve(property, object) ⇒ Object
Attempts to resolve a string as a property of an object. In this context a property is a public method that expects no arguments.
14 15 16 17 18 19 |
# File 'lib/enumpath/resolver/property.rb', line 14 def resolve(property, object) # TODO: return if Enumpath.disable_property_resolver object.public_send(property.to_s.to_sym) rescue ArgumentError, NoMethodError nil end |