Module: JsonAssert::Config

Included in:
JsonAssert
Defined in:
lib/json_assert/config.rb

Constant Summary collapse

DEFAULT_EXCLUDED_KEYS =
%w(id created_at updated_at)

Instance Method Summary collapse

Instance Method Details

#configure(&block) ⇒ Object



7
8
9
# File 'lib/json_assert/config.rb', line 7

def configure(&block)
  instance_eval(&block)
end

#exclude_keys(*keys) ⇒ Object



19
20
21
# File 'lib/json_assert/config.rb', line 19

def exclude_keys(*keys)
  self.excluded_keys = keys
end

#excluded_keysObject



11
12
13
# File 'lib/json_assert/config.rb', line 11

def excluded_keys
  @excluded_keys ||= DEFAULT_EXCLUDED_KEYS
end

#excluded_keys=(keys) ⇒ Object



15
16
17
# File 'lib/json_assert/config.rb', line 15

def excluded_keys=(keys)
  @excluded_keys = keys.map{|k| k.to_s }.uniq
end

#resetObject



23
24
25
# File 'lib/json_assert/config.rb', line 23

def reset
  instance_variables.each{|iv| remove_instance_variable(iv) }
end