Class: LazyNames::Config
- Inherits:
-
Object
- Object
- LazyNames::Config
- Extended by:
- Forwardable
- Defined in:
- lib/lazy_names/config.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#validator ⇒ Object
readonly
Returns the value of attribute validator.
Instance Method Summary collapse
- #constants ⇒ Object
-
#initialize(definitions, path) ⇒ Config
constructor
A new instance of Config.
- #lazy_name(name) ⇒ Object
- #lazy_names ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(definitions, path) ⇒ Config
Returns a new instance of Config.
11 12 13 14 15 |
# File 'lib/lazy_names/config.rb', line 11 def initialize(definitions, path) @definitions = definitions @path = path @validator = ConfigValidator.new(definitions.values, definitions.keys) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/lazy_names/config.rb', line 7 def path @path end |
#validator ⇒ Object (readonly)
Returns the value of attribute validator.
7 8 9 |
# File 'lib/lazy_names/config.rb', line 7 def validator @validator end |
Instance Method Details
#constants ⇒ Object
17 18 19 |
# File 'lib/lazy_names/config.rb', line 17 def constants definitions.keys end |
#lazy_name(name) ⇒ Object
25 26 27 |
# File 'lib/lazy_names/config.rb', line 25 def lazy_name(name) definitions[name] end |
#lazy_names ⇒ Object
21 22 23 |
# File 'lib/lazy_names/config.rb', line 21 def lazy_names definitions.values end |
#validate! ⇒ Object
29 30 31 32 |
# File 'lib/lazy_names/config.rb', line 29 def validate! validator.() remove_invalid_definitions! end |