Class: Uniword::Properties::StyleReference

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/uniword/properties/style_reference.rb

Overview

Style reference element for paragraph styles

Represents <w:pStyle w:val=“…”/> where value is the style ID

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object Also known as: eql?

Compare with another StyleReference or a string



21
22
23
24
25
26
27
28
29
# File 'lib/uniword/properties/style_reference.rb', line 21

def ==(other)
  if other.is_a?(StyleReference)
    value == other.value
  elsif other.is_a?(String)
    value == other
  else
    super
  end
end

#hashObject

For hash key compatibility



39
40
41
# File 'lib/uniword/properties/style_reference.rb', line 39

def hash
  value.hash
end

#to_sObject

For string interpolation and general string-like behavior



34
35
36
# File 'lib/uniword/properties/style_reference.rb', line 34

def to_s
  value.to_s
end