Module: XmlSpec::Configuration
- Included in:
- XmlSpec
- Defined in:
- lib/xml_spec/configuration.rb
Constant Summary collapse
- DEFAULT_EXCLUDED_KEYS =
%w(id created_at updated_at)
Instance Method Summary collapse
- #configure(&block) ⇒ Object
- #directory ⇒ Object
- #directory=(directory) ⇒ Object
- #exclude_keys(*keys) ⇒ Object
- #excluded_keys ⇒ Object
- #excluded_keys=(keys) ⇒ Object
- #reset ⇒ Object
Instance Method Details
#configure(&block) ⇒ Object
8 9 10 |
# File 'lib/xml_spec/configuration.rb', line 8 def configure(&block) instance_eval(&block) end |
#directory ⇒ Object
24 25 26 |
# File 'lib/xml_spec/configuration.rb', line 24 def directory @directory end |
#directory=(directory) ⇒ Object
28 29 30 |
# File 'lib/xml_spec/configuration.rb', line 28 def directory=(directory) @directory = directory end |
#exclude_keys(*keys) ⇒ Object
20 21 22 |
# File 'lib/xml_spec/configuration.rb', line 20 def exclude_keys(*keys) self.excluded_keys = keys end |
#excluded_keys ⇒ Object
12 13 14 |
# File 'lib/xml_spec/configuration.rb', line 12 def excluded_keys @excluded_keys ||= DEFAULT_EXCLUDED_KEYS end |
#excluded_keys=(keys) ⇒ Object
16 17 18 |
# File 'lib/xml_spec/configuration.rb', line 16 def excluded_keys=(keys) @excluded_keys = keys.map(&:to_s).uniq end |
#reset ⇒ Object
32 33 34 |
# File 'lib/xml_spec/configuration.rb', line 32 def reset instance_variables.each{|ivar| remove_instance_variable(ivar) } end |