Sha256: 8ec04a9fbb15e9c9114d2d781583c7dc00d946eb0e6b3f600b8eaa2083350df4

Contents?: true

Size: 927 Bytes

Versions: 2

Compression:

Stored size: 927 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

2 entries across 2 versions & 1 rubygems

Version Path
representable-1.2.3 lib/representable/xml/hash.rb
representable-1.2.2 lib/representable/xml/hash.rb