Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/array_object_path.rb

Overview

Extends the Array class to include a method that converts an array to an ObjectPath

Instance Method Summary collapse

Instance Method Details

#to_object_pathObject

Converts an array to an ObjectPath

+Returns_ (ObjectPaths::ObjectPath) = the ObjectPath representation of the array

Example:

%w[sub_model the_answer].to_object_path
# => #<ObjectPaths::ObjectPath:0x00007f8f9b0b3b08 @path_steps=["sub_model", "the_answer"]>

See ObjectPaths::ObjectPath



14
15
16
# File 'lib/array_object_path.rb', line 14

def to_object_path
  ObjectPaths::ObjectPath.new(self)
end