Class: Prawn::Format::Instructions::Base
- Inherits:
-
Object
- Object
- Prawn::Format::Instructions::Base
- Defined in:
- lib/prawn/format/instructions/base.rb
Instance Attribute Summary collapse
-
#ascent ⇒ Object
readonly
Returns the value of attribute ascent.
-
#descent ⇒ Object
readonly
Returns the value of attribute descent.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
- #accumulate(list) ⇒ Object
- #break? ⇒ Boolean
- #discardable? ⇒ Boolean
- #end_verbatim? ⇒ Boolean
- #force_break? ⇒ Boolean
- #height(*args) ⇒ Object
-
#initialize(state) ⇒ Base
constructor
A new instance of Base.
- #spaces ⇒ Object
- #start_verbatim? ⇒ Boolean
- #style ⇒ Object
- #width(*args) ⇒ Object
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
#ascent ⇒ Object (readonly)
Returns the value of attribute ascent.
8 9 10 |
# File 'lib/prawn/format/instructions/base.rb', line 8 def ascent @ascent end |
#descent ⇒ Object (readonly)
Returns the value of attribute descent.
8 9 10 |
# File 'lib/prawn/format/instructions/base.rb', line 8 def descent @descent end |
#state ⇒ Object (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
31 32 33 |
# File 'lib/prawn/format/instructions/base.rb', line 31 def break? false end |
#discardable? ⇒ Boolean
39 40 41 |
# File 'lib/prawn/format/instructions/base.rb', line 39 def discardable? false end |
#end_verbatim? ⇒ Boolean
47 48 49 |
# File 'lib/prawn/format/instructions/base.rb', line 47 def end_verbatim? false end |
#force_break? ⇒ 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 |
#spaces ⇒ Object
19 20 21 |
# File 'lib/prawn/format/instructions/base.rb', line 19 def spaces 0 end |
#start_verbatim? ⇒ Boolean
43 44 45 |
# File 'lib/prawn/format/instructions/base.rb', line 43 def start_verbatim? false end |
#style ⇒ Object
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 |