Class: Redmine::Views::Builders::Xml

Inherits:
Builder::XmlMarkup
  • Object
show all
Defined in:
lib/redmine/views/builders/xml.rb

Instance Method Summary collapse

Constructor Details

#initialize(request, response) ⇒ Xml

Returns a new instance of Xml.


24
25
26
27
# File 'lib/redmine/views/builders/xml.rb', line 24

def initialize(request, response)
  super()
  instruct!
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object


33
34
35
36
37
38
39
# File 'lib/redmine/views/builders/xml.rb', line 33

def method_missing(sym, *args, &block)
  if args.size == 1 && args.first.is_a?(::Time)
    __send__ sym, args.first.xmlschema, &block
  else
    super
  end
end

Instance Method Details

#array(name, options = {}, &block) ⇒ Object


41
42
43
# File 'lib/redmine/views/builders/xml.rb', line 41

def array(name, options={}, &block)
  __send__ name, (options || {}).merge(:type => 'array'), &block
end

#outputObject


29
30
31
# File 'lib/redmine/views/builders/xml.rb', line 29

def output
  target!
end