Sha256: 1e258ed88dd36603df156ea294b50480cf41ac11f973dd4b82617bed8f20546d

Contents?: true

Size: 900 Bytes

Versions: 20

Compression:

Stored size: 900 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
        representable_attrs.add(:_self, {:hash => true, :use_attributes => true})
      end
    end


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

  module Hash
    include Representable::XML
    include HashMethods

    def self.included(base)
      base.class_eval do
        include Representable
        extend ClassMethods
        representable_attrs.add(:_self, {:hash => true})
      end
    end


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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
representable-2.3.0 lib/representable/xml/hash.rb
representable-2.2.3 lib/representable/xml/hash.rb
representable-2.2.2 lib/representable/xml/hash.rb
representable-2.2.1 lib/representable/xml/hash.rb
representable-2.2.0 lib/representable/xml/hash.rb
representable-2.1.8 lib/representable/xml/hash.rb
representable-2.1.7 lib/representable/xml/hash.rb
representable-2.1.6 lib/representable/xml/hash.rb
representable-2.1.5 lib/representable/xml/hash.rb
representable-2.1.4 lib/representable/xml/hash.rb
representable-2.1.3 lib/representable/xml/hash.rb
representable-2.1.1 lib/representable/xml/hash.rb
representable-2.1.0 lib/representable/xml/hash.rb
representable-2.0.4 lib/representable/xml/hash.rb
representable-2.0.3 lib/representable/xml/hash.rb
representable-2.0.2 lib/representable/xml/hash.rb
representable-2.0.1 lib/representable/xml/hash.rb
representable-2.0.0 lib/representable/xml/hash.rb
representable-2.0.0.rc2 lib/representable/xml/hash.rb
representable-2.0.0.rc1 lib/representable/xml/hash.rb