Module: Uniword::Wordprocessingml::RunProperties::Predicates

Included in:
Uniword::Wordprocessingml::RunProperties
Defined in:
lib/uniword/wordprocessingml/run_properties/predicates.rb

Overview

Boolean predicate methods for RunProperties.

Unwraps boolean property objects and returns true/false.

Instance Method Summary collapse

Instance Method Details

#all_capsObject



34
35
36
# File 'lib/uniword/wordprocessingml/run_properties/predicates.rb', line 34

def all_caps
  caps?
end

#bold?Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
# File 'lib/uniword/wordprocessingml/run_properties/predicates.rb', line 10

def bold?
  val = bold
  return false if val.nil?

  val = val.value if val.is_a?(Uniword::Properties::BooleanElement)
  val == true
end

#caps?Boolean

Returns:

  • (Boolean)


38
39
40
41
42
43
44
# File 'lib/uniword/wordprocessingml/run_properties/predicates.rb', line 38

def caps?
  val = caps
  return false if val.nil?

  val = val.value if val.is_a?(Uniword::Properties::BooleanElement)
  val == true
end

#emboss?Boolean

Returns:

  • (Boolean)


70
71
72
73
74
75
76
# File 'lib/uniword/wordprocessingml/run_properties/predicates.rb', line 70

def emboss?
  val = emboss
  return false if val.nil?

  val = val.value if val.is_a?(Properties::Emboss)
  val == true
end

#hidden?Boolean

Returns:

  • (Boolean)


78
79
80
81
82
83
84
# File 'lib/uniword/wordprocessingml/run_properties/predicates.rb', line 78

def hidden?
  val = hidden
  return false if val.nil?

  val = val.value if val.is_a?(Properties::Vanish)
  val == true
end

#imprint?Boolean

Returns:

  • (Boolean)


62
63
64
65
66
67
68
# File 'lib/uniword/wordprocessingml/run_properties/predicates.rb', line 62

def imprint?
  val = imprint
  return false if val.nil?

  val = val.value if val.is_a?(Properties::Imprint)
  val == true
end

#italic?Boolean

Returns:

  • (Boolean)


18
19
20
21
22
23
24
# File 'lib/uniword/wordprocessingml/run_properties/predicates.rb', line 18

def italic?
  val = italic
  return false if val.nil?

  val = val.value if val.is_a?(Uniword::Properties::BooleanElement)
  val == true
end

#outline?Boolean

Returns:

  • (Boolean)


86
87
88
89
90
91
92
# File 'lib/uniword/wordprocessingml/run_properties/predicates.rb', line 86

def outline?
  val = outline
  return false if val.nil?

  val = val.val if val.is_a?(Properties::Outline)
  val != "false"
end

#shadow?Boolean

Returns:

  • (Boolean)


54
55
56
57
58
59
60
# File 'lib/uniword/wordprocessingml/run_properties/predicates.rb', line 54

def shadow?
  val = shadow
  return false if val.nil?

  val = val.value if val.is_a?(Properties::Shadow)
  val == true
end

#small_caps?Boolean

Returns:

  • (Boolean)


46
47
48
49
50
51
52
# File 'lib/uniword/wordprocessingml/run_properties/predicates.rb', line 46

def small_caps?
  val = small_caps
  return false if val.nil?

  val = val.value if val.is_a?(Properties::SmallCaps)
  val == true
end

#strike?Boolean

Returns:

  • (Boolean)


26
27
28
29
30
31
32
# File 'lib/uniword/wordprocessingml/run_properties/predicates.rb', line 26

def strike?
  val = strike
  return false if val.nil?

  val = val.value if val.is_a?(Uniword::Properties::BooleanElement)
  val == true
end