Class: OpenUSD::AssetPath
- Inherits:
-
Object
- Object
- OpenUSD::AssetPath
- Defined in:
- lib/openusd/value.rb
Overview
An authored USD asset path, optionally paired with its resolved path.
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#resolved_path ⇒ Object
readonly
Returns the value of attribute resolved_path.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean (also: #==)
-
#hash ⇒ Integer
Value hash.
-
#initialize(path, resolved_path: nil) ⇒ AssetPath
constructor
A new instance of AssetPath.
-
#to_s ⇒ String
Authored, unresolved asset path.
Constructor Details
#initialize(path, resolved_path: nil) ⇒ AssetPath
Returns a new instance of AssetPath.
16 17 18 19 20 |
# File 'lib/openusd/value.rb', line 16 def initialize(path, resolved_path: nil) @path = String(path).dup.freeze @resolved_path = resolved_path.nil? ? nil : resolved_path.to_s.dup.freeze freeze end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
14 15 16 |
# File 'lib/openusd/value.rb', line 14 def path @path end |
#resolved_path ⇒ Object (readonly)
Returns the value of attribute resolved_path.
14 15 16 |
# File 'lib/openusd/value.rb', line 14 def resolved_path @resolved_path end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
22 23 24 |
# File 'lib/openusd/value.rb', line 22 def eql?(other) other.is_a?(self.class) && path == other.path && resolved_path == other.resolved_path end |
#hash ⇒ Integer
Returns value hash.
28 29 30 |
# File 'lib/openusd/value.rb', line 28 def hash [path, resolved_path].hash end |
#to_s ⇒ String
Returns authored, unresolved asset path.
33 34 35 |
# File 'lib/openusd/value.rb', line 33 def to_s path end |