Sha256: 62348b8bf2bdcc3acb1be8945ccdab0dea78b1beb0018725dad93a832c388366
Contents?: true
Size: 422 Bytes
Versions: 84
Compression:
Stored size: 422 Bytes
Contents
class Object def nested_send(symbol) return __send__(symbol) if respond_to?(symbol) obj = nil symbol.to_s.split('.').each do |part| nested_symbol = part.to_sym if obj break unless obj.respond_to?(nested_symbol) obj = obj.__send__(nested_symbol) else break unless respond_to?(nested_symbol) obj = __send__(nested_symbol) end end obj end end
Version data entries
84 entries across 84 versions & 1 rubygems