Sha256: 2ef386b7ee26fd4d43174b6a86db88c82c88880603ff4d791fef6d1bb4e7cf31

Contents?: true

Size: 550 Bytes

Versions: 12

Compression:

Stored size: 550 Bytes

Contents

module Almodovar
  module ToXml
    def to_xml(options = {}, &block)
      return super(options, &block) if !options[:convert_links] || options.delete(:skip_links_one_level)
      options[:builder].tag!(:link, rel: options[:root]) do |xml|
        super options.merge(skip_links_one_level: self.is_a?(Array)), &block
      end
    end
  end

  class Resource
    def to_xml(options = {})
      options[:builder].tag!(:link, rel: options[:root], href: url)
    end
  end
end

Array.send :prepend, Almodovar::ToXml
Hash.send :prepend, Almodovar::ToXml

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
almodovar-2.0.2 lib/almodovar/to_xml.rb
almodovar-2.0.1 lib/almodovar/to_xml.rb
almodovar-1.8.1 lib/almodovar/to_xml.rb
almodovar-2.0.0 lib/almodovar/to_xml.rb
almodovar-1.8.0 lib/almodovar/to_xml.rb
almodovar-1.7.8 lib/almodovar/to_xml.rb
almodovar-1.7.7 lib/almodovar/to_xml.rb
almodovar-1.7.6 lib/almodovar/to_xml.rb
almodovar-1.7.3 lib/almodovar/to_xml.rb
almodovar-1.7.2 lib/almodovar/to_xml.rb
almodovar-1.7.1 lib/almodovar/to_xml.rb
almodovar-1.7.0 lib/almodovar/to_xml.rb