Class: GtfsReader::Config::Sources
- Inherits:
-
BasicObject
- Defined in:
- lib/gtfs_reader/config/sources.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of Sources.
6
7
8
|
# File 'lib/gtfs_reader/config/sources.rb', line 6
def initialize
@sources = {}
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *_args, &block) ⇒ Object
18
19
20
21
22
|
# File 'lib/gtfs_reader/config/sources.rb', line 18
def method_missing(name, *_args, &block)
(@sources[name] ||= Source.new name).tap do |src|
src.instance_exec(src, &block) if ::Kernel.block_given?
end
end
|
Instance Method Details
#[](key) ⇒ Object
14
15
16
|
# File 'lib/gtfs_reader/config/sources.rb', line 14
def [](key)
@sources[key]
end
|
#each(&block) ⇒ Object
10
11
12
|
# File 'lib/gtfs_reader/config/sources.rb', line 10
def each(&block)
@sources.each(&block)
end
|
#respond_to_missing?(_name, _include_private = false) ⇒ Boolean
24
25
26
|
# File 'lib/gtfs_reader/config/sources.rb', line 24
def respond_to_missing?(_name, _include_private = false)
true
end
|