Class: Prawn::Format::Instructions::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/prawn/format/instructions/base.rb

Direct Known Subclasses

TagClose, TagOpen, Text

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(state) ⇒ Base

Returns a new instance of Base.



10
11
12
13
14
15
16
17
# File 'lib/prawn/format/instructions/base.rb', line 10

def initialize(state)
  @state = state
  state.document.font_size(state.font_size) do
    @height = state.font.height
    @ascent = state.font.ascender
    @descent = state.font.descender
  end
end

Instance Attribute Details

#ascentObject (readonly)

Returns the value of attribute ascent.



8
9
10
# File 'lib/prawn/format/instructions/base.rb', line 8

def ascent
  @ascent
end

#descentObject (readonly)

Returns the value of attribute descent.



8
9
10
# File 'lib/prawn/format/instructions/base.rb', line 8

def descent
  @descent
end

#stateObject (readonly)

Returns the value of attribute state.



8
9
10
# File 'lib/prawn/format/instructions/base.rb', line 8

def state
  @state
end

Instance Method Details

#accumulate(list) ⇒ Object



55
56
57
# File 'lib/prawn/format/instructions/base.rb', line 55

def accumulate(list)
  list.push(self)
end

#break?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/prawn/format/instructions/base.rb', line 31

def break?
  false
end

#discardable?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/prawn/format/instructions/base.rb', line 39

def discardable?
  false
end

#end_verbatim?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/prawn/format/instructions/base.rb', line 47

def end_verbatim?
  false
end

#force_break?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/prawn/format/instructions/base.rb', line 35

def force_break?
  false
end

#height(*args) ⇒ Object



27
28
29
# File 'lib/prawn/format/instructions/base.rb', line 27

def height(*args)
  @height
end

#spacesObject



19
20
21
# File 'lib/prawn/format/instructions/base.rb', line 19

def spaces
  0
end

#start_verbatim?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/prawn/format/instructions/base.rb', line 43

def start_verbatim?
  false
end

#styleObject



51
52
53
# File 'lib/prawn/format/instructions/base.rb', line 51

def style
  {}
end

#width(*args) ⇒ Object



23
24
25
# File 'lib/prawn/format/instructions/base.rb', line 23

def width(*args)
  0
end