Class: OpenUSD::ListOp

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

Overview

Preserves a USDA list-edit operator together with its value.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(operation, value) ⇒ ListOp

Returns a new instance of ListOp.



42
43
44
45
46
# File 'lib/openusd/value.rb', line 42

def initialize(operation, value)
  @operation = operation.to_sym
  @value = value
  freeze
end

Instance Attribute Details

#operationObject (readonly)

Returns the value of attribute operation.



40
41
42
# File 'lib/openusd/value.rb', line 40

def operation
  @operation
end

#valueObject (readonly)

Returns the value of attribute value.



40
41
42
# File 'lib/openusd/value.rb', line 40

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object

Compare the list operation and value.



49
50
51
# File 'lib/openusd/value.rb', line 49

def ==(other)
  other.is_a?(self.class) && operation == other.operation && value == other.value
end