Class: Prawn::Format::Instructions::TagOpen

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

Instance Attribute Summary collapse

Attributes inherited from Base

#ascent, #descent, #state

Instance Method Summary collapse

Methods inherited from Base

#accumulate, #break?, #discardable?, #end_verbatim?, #force_break?, #height, #spaces

Constructor Details

#initialize(state, tag) ⇒ TagOpen

Returns a new instance of TagOpen.



14
15
16
17
# File 'lib/prawn/format/instructions/tag_open.rb', line 14

def initialize(state, tag)
  super(state)
  @tag = tag
end

Instance Attribute Details

#tagObject (readonly)

Returns the value of attribute tag.



12
13
14
# File 'lib/prawn/format/instructions/tag_open.rb', line 12

def tag
  @tag
end

Instance Method Details

#draw(document, draw_state, options = {}) ⇒ Object



19
20
21
22
23
24
# File 'lib/prawn/format/instructions/tag_open.rb', line 19

def draw(document, draw_state, options={})
  draw_width(document, draw_state)
  draw_destination(document, draw_state)
  draw_link(document, draw_state)
  draw_underline(document, draw_state)
end

#start_verbatim?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/prawn/format/instructions/tag_open.rb', line 26

def start_verbatim?
  @tag[:style][:white_space] == :pre
end

#styleObject



30
31
32
# File 'lib/prawn/format/instructions/tag_open.rb', line 30

def style
  @tag[:style]
end

#widthObject



34
35
36
# File 'lib/prawn/format/instructions/tag_open.rb', line 34

def width
  @state.width
end