Sha256: 29cc84e5a226ae7880608dfdb1633b0986c494f49daabb91c7714ace00b2ed77

Contents?: true

Size: 889 Bytes

Versions: 5

Compression:

Stored size: 889 Bytes

Contents

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

5 entries across 5 versions & 1 rubygems

Version Path
representable-1.2.8 lib/representable/xml/hash.rb
representable-1.2.7 lib/representable/xml/hash.rb
representable-1.2.6 lib/representable/xml/hash.rb
representable-1.2.5 lib/representable/xml/hash.rb
representable-1.2.4 lib/representable/xml/hash.rb