Module: FlightConfig::Links::ClassMethods
- Includes:
- Globber::ClassMethods
- Defined in:
- lib/flight_config/links.rb
Instance Method Summary collapse
Methods included from Globber::ClassMethods
Instance Method Details
#define_link(key, klass, glob: false, &b) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/flight_config/links.rb', line 37 def define_link(key, klass, glob: false, &b) links_class.define_method(key) do args = config.instance_exec(&b) method = (glob ? :glob_read : :read) klass.public_send(method, *args, registry: config.__registry__) end end |
#links_class ⇒ Object
45 46 47 |
# File 'lib/flight_config/links.rb', line 45 def links_class @links_class ||= Struct.new(:config) end |