Class: Uniword::Properties::RunStyleReference

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

Overview

Style reference element for character/run styles

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

Instance Method Summary collapse

Instance Method Details

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

Compare with another RunStyleReference or a string



58
59
60
61
62
63
64
65
66
# File 'lib/uniword/properties/style_reference.rb', line 58

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

#hashObject

For hash key compatibility



76
77
78
# File 'lib/uniword/properties/style_reference.rb', line 76

def hash
  value.hash
end

#to_sObject

For string interpolation and general string-like behavior



71
72
73
# File 'lib/uniword/properties/style_reference.rb', line 71

def to_s
  value.to_s
end