Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/string_object_path.rb
Overview
Extends the String class to include a method that converts a string to an ObjectPath
Instance Method Summary collapse
-
#to_object_path ⇒ Object
Converts a string to an ObjectPath.
Instance Method Details
#to_object_path ⇒ Object
Converts a string to an ObjectPath
+Returns_ (ObjectPaths::ObjectPath) = the ObjectPath representation of the string
Example:
'sub_model/the_answer'.to_object_path
# => #<ObjectPaths::ObjectPath:0x00007f8f9b0b3b08 @path_steps=["sub_model", "the_answer"]>
See ObjectPaths::ObjectPath
14 15 16 |
# File 'lib/string_object_path.rb', line 14 def to_object_path ObjectPaths::ObjectPath.new(self) end |