Class: Directive::Reader

Inherits:
Object
  • Object
show all
Includes:
Tablesalt::StringableObject
Defined in:
lib/directive/reader.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Reader

Returns a new instance of Reader.



7
8
9
# File 'lib/directive/reader.rb', line 7

def initialize(config)
  @config = config
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name) ⇒ Object (private)



19
20
21
22
23
24
# File 'lib/directive/reader.rb', line 19

def method_missing(method_name, *)
  return mutex.synchronize { config.public_send(method_name) } if config._options.include?(method_name)
  return config._nested_builders[method_name].reader if config._nested_builders.key?(method_name)

  super
end

Instance Method Details

#config_eval(*path) ⇒ Object



11
12
13
# File 'lib/directive/reader.rb', line 11

def config_eval(*path)
  Evaluator.new(path, self)
end