Module: RichText::Styleable

Included in:
Document::Entry
Defined in:
lib/richtext/styleable.rb

Instance Method Summary collapse

Instance Method Details

#bold=(b) ⇒ Object

Sets bold to either true or false, depending on the given argument.



12
13
14
# File 'lib/richtext/styleable.rb', line 12

def bold=(b)
  self[:bold] = b ? true : false
end

#bold?Boolean

Returns true if bold formatting is applied.

Returns:

  • (Boolean)


6
7
8
# File 'lib/richtext/styleable.rb', line 6

def bold?
  self[:bold]
end

#colorObject

Returns the color value if it is set, otherwise nil.



46
47
48
# File 'lib/richtext/styleable.rb', line 46

def color
  self[:color]
end

#color=(c) ⇒ Object

Sets the color value.



52
53
54
# File 'lib/richtext/styleable.rb', line 52

def color=(c)
  self[:color] = c
end

#fontObject

Returns the font value if it is set, otherwise nil.



58
59
60
# File 'lib/richtext/styleable.rb', line 58

def font
  self[:font]
end

#font=(f) ⇒ Object

Sets the font value.



64
65
66
# File 'lib/richtext/styleable.rb', line 64

def font=(f)
  self[:font] = f
end

#italic=(i) ⇒ Object

Sets italic to either true or false, depending on the given argument.



24
25
26
# File 'lib/richtext/styleable.rb', line 24

def italic=(i)
  self[:italic] = i ? true : false
end

#italic?Boolean

Returns true if italic formatting is applied.

Returns:

  • (Boolean)


18
19
20
# File 'lib/richtext/styleable.rb', line 18

def italic?
  self[:italic]
end

#underlined=(u) ⇒ Object Also known as: underline=

Sets underlined to either true or false, depending on the given argument.



38
39
40
# File 'lib/richtext/styleable.rb', line 38

def underlined=(u)
  self[:underlined] = u ? true : false
end

#underlined?Boolean Also known as: underline?

Returns true if underlined formatting is applied.

Returns:

  • (Boolean)


30
31
32
# File 'lib/richtext/styleable.rb', line 30

def underlined?
  self[:underlined]
end