instance method instruct!

Ruby on Rails 2.3.18

Since v2.2.3 Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

instruct!(directive_tag=:xml, attrs={})

Insert a processing instruction into the XML markup. E.g.

For example:

xml.instruct!
    #=> <?xml version="1.0" encoding="UTF-8"?>
xml.instruct! :aaa, :bbb=>"ccc"
    #=> <?aaa bbb="ccc"?>

Parameters

directive_tag opt = :xml
attrs opt = {}
Source
# File activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlmarkup.rb, line 238
    def instruct!(directive_tag=:xml, attrs={})
      _ensure_no_block block_given?
      if directive_tag == :xml
        a = { :version=>"1.0", :encoding=>"UTF-8" }
        attrs = a.merge attrs
      end
      _special(
      "<?#{directive_tag}",
      "?>",
      nil,
      attrs,
      [:version, :encoding, :standalone])
    end

Defined in activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlmarkup.rb line 238 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Builder::XmlMarkup

Type at least 2 characters to search.

↑↓ navigate · open · esc close