Sha256: 30ad26f3c3ad1a7ca9abc67d4aca88a79069cd573b7b002210723c29ed302d03

Contents?: true

Size: 477 Bytes

Versions: 3

Compression:

Stored size: 477 Bytes

Contents

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
        property(:_self, hash: true)
      end
    end


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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
representable-3.0.4 lib/representable/json/hash.rb
representable-3.0.3 lib/representable/json/hash.rb
representable-3.0.2 lib/representable/json/hash.rb