Class: FigFig
- Inherits:
-
Object
- Object
- FigFig
- Defined in:
- lib/fig_fig.rb,
lib/fig_fig/version.rb
Overview
Top level class of the FigTree gem
Defined Under Namespace
Classes: ConfigurationContainer
Constant Summary collapse
- MissingConfigurationError =
Class.new StandardError
- DuplicateParameterDefinitionError =
Class.new StandardError
- CannotModifyLockedParameterError =
Class.new StandardError
- InvalidLockOptionError =
Class.new StandardError
- ConfigurationAlreadyDefinedError =
Class.new StandardError
- VERSION =
"0.2.0"
Class Attribute Summary collapse
-
.configuration ⇒ Object
Returns the value of attribute configuration.
Class Method Summary collapse
-
.configure(reset: nil) {|configuration| ... } ⇒ Object
And we define a wrapper for the configuration block, that we’ll use to set up our set of options.
- .method_missing(method_name, *args, &blk) ⇒ Object
- .reset ⇒ Object
- .respond_to_missing?(method, _include_private = false) ⇒ Boolean
Class Attribute Details
.configuration ⇒ Object
Returns the value of attribute configuration.
10 11 12 |
# File 'lib/fig_fig.rb', line 10 def configuration @configuration end |
Class Method Details
.configure(reset: nil) {|configuration| ... } ⇒ Object
And we define a wrapper for the configuration block, that we’ll use to set up our set of options
14 15 16 17 18 19 20 21 |
# File 'lib/fig_fig.rb', line 14 def configure(reset: nil) self.reset if reset raise ConfigurationAlreadyDefinedError if @configuration @configuration = ConfigurationContainer.new @configuration.configuring = true yield configuration if block_given? @configuration.configuring = false end |
.method_missing(method_name, *args, &blk) ⇒ Object
31 32 33 34 |
# File 'lib/fig_fig.rb', line 31 def method_missing(method_name, *args, &blk) return super unless configuration.respond_to? method_name configuration.send method_name, *args, &blk end |
.reset ⇒ Object
27 28 29 |
# File 'lib/fig_fig.rb', line 27 def reset @configuration = nil end |
.respond_to_missing?(method, _include_private = false) ⇒ Boolean
36 37 38 |
# File 'lib/fig_fig.rb', line 36 def respond_to_missing?(method, _include_private = false) configuration.respond_to?(method) || super end |