Class: Prawn::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/crayfish/html.rb

Defined Under Namespace

Classes: Cell

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#post_resizeObject

Returns the value of attribute post_resize.



60
61
62
# File 'lib/crayfish/html.rb', line 60

def post_resize
  @post_resize
end

Instance Method Details

#crayfish_debug_dump(node) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/crayfish/html.rb', line 35

def crayfish_debug_dump node
  if node.kind_of? Prawn::Table
    (0..node.row_length).map do |n|
      crayfish_debug_dump node.row(n).map{ |c| crayfish_debug_dump c }
    end
  elsif node.kind_of? Prawn::Table::Cell::Text
    node.content
  elsif node.kind_of? Array
    node.map{ |c| crayfish_debug_dump c }
  elsif node.kind_of? String
    node
  elsif node.kind_of? Fixnum
    node
  elsif node.kind_of? Hash
    node.map{ |k,v| [k,crayfish_debug_dump(v)] }
  else
    node.class.name
  end
end

#inspectObject

inspect with human readable output



56
57
58
# File 'lib/crayfish/html.rb', line 56

def inspect
  "<Prawn::Table #{crayfish_debug_dump(self).inspect}>"
end