class Parchment::Style

Constants

AVAILABLE_FORMATTING

Attributes

family[R]
font_size[R]
font_style[R]
font_weight[R]
id[R]
name[R]
parent_style_name[R]
text_align[R]
text_underline_style[R]

Public Class Methods

new(node) click to toggle source

This needs to be defined in each format’s subclass.

# File lib/parchment/style.rb, line 25
def initialize(node)
  raise MissingFormatterMethodError
end

Public Instance Methods

aligned_center?() click to toggle source
# File lib/parchment/style.rb, line 57
def aligned_center?
  @text_align == :center
end
aligned_left?() click to toggle source
# File lib/parchment/style.rb, line 49
def aligned_left?
  [:left, nil].include?(@text_align)
end
aligned_right?() click to toggle source
# File lib/parchment/style.rb, line 53
def aligned_right?
  @text_align == :right
end
bold?() click to toggle source
# File lib/parchment/style.rb, line 37
def bold?
  @font_weight == 'bold'
end
italic?() click to toggle source
# File lib/parchment/style.rb, line 41
def italic?
  @font_style == 'italic'
end
paragraph?() click to toggle source
# File lib/parchment/style.rb, line 29
def paragraph?
  @family == 'paragraph'
end
text?() click to toggle source
# File lib/parchment/style.rb, line 33
def text?
  @family == 'text'
end
underline?() click to toggle source
# File lib/parchment/style.rb, line 45
def underline?
  !@text_underline_style.nil?
end