Class/Module Index [+]

Quicksearch

Origami::XFA::ClassMethods

Public Instance Methods

mime_type(type) click to toggle source
# File lib/origami/xfa.rb, line 74
def mime_type(type)
  send(:define_method, "mime_type") { return type }
end
xfa_attribute(name) click to toggle source
# File lib/origami/xfa.rb, line 48
def xfa_attribute(name)

  read_xml_attr = lambda { return self.attributes[name.to_s] }
  write_xml_attr = lambda { |value| self.attributes[name.to_s] = value }

  send(:define_method, "attr_#{name.to_s}", read_xml_attr)
  send(:define_method, "attr_#{name.to_s}=", write_xml_attr)

end
xfa_node(name, type, range = (0..(1.0/0))) click to toggle source
# File lib/origami/xfa.rb, line 58
def xfa_node(name, type, range = (0..(1.0/0)))
  add_child = lambda { |*attr|
    elt = self.add_element(type.new)

    unless attr.empty?
      attr.first.each do |k,v|
        elt.attributes[k.to_s] = v
      end
    end

    return elt
  }

  send(:define_method, "add_#{name}", add_child)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.