Module: JsonSpec::Configuration
- Included in:
- JsonSpec
- Defined in:
- lib/json_spec/configuration.rb
Constant Summary collapse
- DEFAULT_EXCLUDED_KEYS =
%w(id created_at updated_at)
Instance Attribute Summary collapse
-
#directory ⇒ Object
Returns the value of attribute directory.
Instance Method Summary collapse
- #configure(&block) ⇒ Object
- #exclude_keys(*keys) ⇒ Object
- #excluded_keys ⇒ Object
- #excluded_keys=(keys) ⇒ Object
- #reset ⇒ Object
Instance Attribute Details
#directory ⇒ Object
Returns the value of attribute directory.
7 8 9 |
# File 'lib/json_spec/configuration.rb', line 7 def directory @directory end |
Instance Method Details
#configure(&block) ⇒ Object
9 10 11 |
# File 'lib/json_spec/configuration.rb', line 9 def configure(&block) instance_eval(&block) end |
#exclude_keys(*keys) ⇒ Object
21 22 23 |
# File 'lib/json_spec/configuration.rb', line 21 def exclude_keys(*keys) self.excluded_keys = keys end |
#excluded_keys ⇒ Object
13 14 15 |
# File 'lib/json_spec/configuration.rb', line 13 def excluded_keys @excluded_keys ||= DEFAULT_EXCLUDED_KEYS end |
#excluded_keys=(keys) ⇒ Object
17 18 19 |
# File 'lib/json_spec/configuration.rb', line 17 def excluded_keys=(keys) @excluded_keys = keys.map(&:to_s).uniq end |
#reset ⇒ Object
26 27 28 |
# File 'lib/json_spec/configuration.rb', line 26 def reset instance_variables.each { |ivar| remove_instance_variable(ivar) } end |