Module: JsonSpec::Configuration
- Included in:
- JsonSpec
- Defined in:
- lib/json_spec/configuration.rb
Constant Summary
- DEFAULT_EXCLUDED_KEYS =
%w(id created_at updated_at)
Instance Method Summary (collapse)
- - (Object) configure(&block)
- - (Object) exclude_keys(*keys)
- - (Object) excluded_keys
- - (Object) excluded_keys=(keys)
- - (Object) reset
Instance Method Details
- (Object) configure(&block)
7 8 9 |
# File 'lib/json_spec/configuration.rb', line 7 def configure(&block) instance_eval(&block) end |
- (Object) exclude_keys(*keys)
19 20 21 |
# File 'lib/json_spec/configuration.rb', line 19 def exclude_keys(*keys) self.excluded_keys = keys end |
- (Object) excluded_keys
11 12 13 |
# File 'lib/json_spec/configuration.rb', line 11 def excluded_keys @excluded_keys ||= DEFAULT_EXCLUDED_KEYS end |
- (Object) excluded_keys=(keys)
15 16 17 |
# File 'lib/json_spec/configuration.rb', line 15 def excluded_keys=(keys) @excluded_keys = keys.map{|k| k.to_s }.uniq end |
- (Object) reset
23 24 25 |
# File 'lib/json_spec/configuration.rb', line 23 def reset instance_variables.each{|iv| remove_instance_variable(iv) } end |