Class: Dumbo::BindingLoader
- Inherits:
-
Object
- Object
- Dumbo::BindingLoader
- Defined in:
- lib/dumbo/binding_loader.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file) ⇒ BindingLoader
constructor
A new instance of BindingLoader.
- #load ⇒ Object
Constructor Details
#initialize(file) ⇒ BindingLoader
Returns a new instance of BindingLoader.
9 10 11 |
# File 'lib/dumbo/binding_loader.rb', line 9 def initialize(file) @file = file end |
Class Method Details
.load_pattern ⇒ Object
5 6 7 |
# File 'lib/dumbo/binding_loader.rb', line 5 def self.load_pattern /\s*--\s*load +([^\s'";]+)/ end |
Instance Method Details
#load ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/dumbo/binding_loader.rb', line 13 def load load_list.reduce({}) do |result, file| yaml = Pathname.new(file).sub_ext('.yml') bind = YAML.load_file(yaml) result.merge(bind) end end |