Sha256: 8dc72f4c85e47a7c74228b86f6c2ddf561ee4a850eec235d6071fa80982758da

Contents?: true

Size: 526 Bytes

Versions: 20

Compression:

Stored size: 526 Bytes

Contents

require 'representable/json'
require 'representable/hash_methods'

module Representable::JSON
  # "Lonely Hash" support.
  module Hash
    def self.included(base)
      base.class_eval do
        include Representable
        extend ClassMethods
        include Representable::JSON
        include Representable::HashMethods
        representable_attrs.add(:_self, {:hash => true})
      end
    end


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

Version data entries

20 entries across 20 versions & 1 rubygems

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