Module: Conferrable
- Defined in:
- lib/conferrable/entry.rb,
lib/conferrable/version.rb,
lib/conferrable/conferrable.rb,
lib/conferrable/configuration.rb,
lib/conferrable/file_utilities.rb,
lib/conferrable/file_based_configuration.rb
Overview
Copyright © 2018-present, Blue Marble Payroll, LLC
This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
Defined Under Namespace
Classes: Configuration, Entry, FileBasedConfiguration, FileUtilities
Constant Summary
collapse
- VERSION =
'1.1.0'
- GET_PREFIX_MATCHER_REGEX =
/^get_(.+)$/.freeze
- GET_PREFIX_REGEX =
/^get_/.freeze
Class Method Summary
collapse
Class Method Details
.[](key) ⇒ Object
34
35
36
|
# File 'lib/conferrable/conferrable.rb', line 34
def [](key)
get(key)
end
|
.clear! ⇒ Object
24
25
26
27
28
|
# File 'lib/conferrable/conferrable.rb', line 24
def clear!
@entries = {}
nil
end
|
.entry(key) ⇒ Object
42
43
44
45
46
47
48
|
# File 'lib/conferrable/conferrable.rb', line 42
def entry(key)
clear! unless @entries
@entries[key.to_s] = Entry.new(key) unless @entries[key.to_s]
@entries[key.to_s]
end
|
.get(key) ⇒ Object
38
39
40
|
# File 'lib/conferrable/conferrable.rb', line 38
def get(key)
entry(key).all
end
|
.method_missing(method_sym, *arguments, &block) ⇒ Object
50
51
52
53
54
55
56
|
# File 'lib/conferrable/conferrable.rb', line 50
def method_missing(method_sym, *arguments, &block)
if method_sym.to_s =~ GET_PREFIX_MATCHER_REGEX
get(keyify(method_sym))
else
super
end
end
|
.respond_to_missing?(method_sym, include_private = false) ⇒ Boolean
58
59
60
|
# File 'lib/conferrable/conferrable.rb', line 58
def respond_to_missing?(method_sym, include_private = false)
method_sym.to_s =~ GET_PREFIX_MATCHER_REGEX || super
end
|
.set_filenames(key, filenames) ⇒ Object
30
31
32
|
# File 'lib/conferrable/conferrable.rb', line 30
def set_filenames(key, filenames)
entry(key).filenames = filenames
end
|