Class: OpenUSD::AssetPath

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

Overview

An authored USD asset path, optionally paired with its resolved path.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

#resolved_pathObject (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: ==

Returns:

  • (Boolean)


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

#hashInteger

Returns value hash.

Returns:

  • (Integer)

    value hash



28
29
30
# File 'lib/openusd/value.rb', line 28

def hash
  [path, resolved_path].hash
end

#to_sString

Returns authored, unresolved asset path.

Returns:

  • (String)

    authored, unresolved asset path



33
34
35
# File 'lib/openusd/value.rb', line 33

def to_s
  path
end