Sha256: 7a103d76bd0e1fa8c191c27deee9d1a52cfd7bdfe716a4532e9111068d11f896
Contents?: true
Size: 508 Bytes
Versions: 9
Compression:
Stored size: 508 Bytes
Contents
require "set" module JsonSpec module Configuration DEFAULT_EXCLUDED_KEYS = %w(id created_at updated_at) def configure(&block) instance_eval(&block) end def excluded_keys @excluded_keys ||= DEFAULT_EXCLUDED_KEYS end def excluded_keys=(keys) @excluded_keys = keys.map{|k| k.to_s }.uniq end def exclude_keys(*keys) self.excluded_keys = keys end def reset instance_variables.each{|iv| remove_instance_variable(iv) } end end end
Version data entries
9 entries across 9 versions & 1 rubygems