Sha256: 9b0833a0787c51ec00e98340287c5ef7306bbfafb8e5520f13b4b011ce403397

Contents?: true

Size: 917 Bytes

Versions: 30

Compression:

Stored size: 917 Bytes

Contents

require 'representable/xml'
require 'representable/hash_methods'

module Representable::XML
  module AttributeHash
    include Representable::XML
    include Representable::HashMethods

    def self.included(base)
      base.class_eval do
        include Representable
        extend ClassMethods
      end
    end


    module ClassMethods
      def values(options)
        hash :_self, options.merge!(:use_attributes => true)
      end
    end


    def definition_opts
      [:_self, {:hash => true, :use_attributes => true}]
    end
  end

  module Hash
    include Representable::XML
    include HashMethods

    def self.included(base)
      base.class_eval do
        include Representable
        extend ClassMethods
      end
    end


    module ClassMethods
      def values(options)
        hash :_self, options
      end
    end


   def definition_opts
      [:_self, {:hash => true}]
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
representable-1.8.5 lib/representable/xml/hash.rb
representable-1.8.4 lib/representable/xml/hash.rb
representable-1.8.3 lib/representable/xml/hash.rb
representable-1.8.2 lib/representable/xml/hash.rb
representable-1.8.1 lib/representable/xml/hash.rb
representable-1.8.0 lib/representable/xml/hash.rb
representable-1.7.7 lib/representable/xml/hash.rb
representable-1.7.6 lib/representable/xml/hash.rb
representable-1.7.5 lib/representable/xml/hash.rb
representable-1.7.4 lib/representable/xml/hash.rb
representable-1.7.3 lib/representable/xml/hash.rb
representable-1.7.2 lib/representable/xml/hash.rb
representable-1.7.1 lib/representable/xml/hash.rb
representable-1.7.0 lib/representable/xml/hash.rb
representable-1.6.1 lib/representable/xml/hash.rb
representable-1.6.0 lib/representable/xml/hash.rb
representable-1.5.3 lib/representable/xml/hash.rb
representable-1.5.2 lib/representable/xml/hash.rb
representable-1.5.1 lib/representable/xml/hash.rb
representable-1.5.0 lib/representable/xml/hash.rb