Class: Prawn::Blank::Form

Inherits:
Hash
  • Object
show all
Defined in:
lib/prawn/blank/form.rb

Instance Method Summary collapse

Constructor Details

#initializeForm

Returns a new instance of Form.



2
3
4
5
6
# File 'lib/prawn/blank/form.rb', line 2

def initialize()
  super()
  self[:DR] = {}
  self[:Fields] = []
end

Instance Method Details

#add_field(field) ⇒ Object



22
23
24
# File 'lib/prawn/blank/form.rb', line 22

def add_field(field)
  self[:Fields] << field
end

#add_ressource(type, name, dict) ⇒ Object



8
9
10
11
# File 'lib/prawn/blank/form.rb', line 8

def add_ressource(type,name,dict)
  self[:DR][type] ||={}
  self[:DR][type][name] ||= dict
end

#add_ressources(hash) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/prawn/blank/form.rb', line 13

def add_ressources(hash)
  puts hash.inspect
  hash.each do |type, names|
    names.each do |name,dict|
      add_ressource(type, name, dict)
    end
  end
end