Class: CaptainHoog::Hoogfile
- Defined in:
- lib/captain_hoog/hoogfile.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path) ⇒ Hoogfile
constructor
A new instance of Hoogfile.
- #plugins_config ⇒ Object (also: #plugins_env)
Methods inherited from Struct
#fetch, #method_missing, #respond_to_missing?
Constructor Details
#initialize(path) ⇒ Hoogfile
Returns a new instance of Hoogfile.
12 13 14 15 |
# File 'lib/captain_hoog/hoogfile.rb', line 12 def initialize(path) @path = path super(hoogfile) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class CaptainHoog::Struct
Class Method Details
.read(path) ⇒ Object
4 5 6 |
# File 'lib/captain_hoog/hoogfile.rb', line 4 def self.read(path) self.send(:new,path) end |
Instance Method Details
#plugins_config ⇒ Object Also known as: plugins_env
17 18 19 20 21 22 23 24 25 |
# File 'lib/captain_hoog/hoogfile.rb', line 17 def plugins_config # select all plugin config into an env hash config = self.to_h.reduce({}) do |plugins_env_hash, (item_key, item_value)| unless reserved_keys.include?(item_key) plugins_env_hash.update(item_key => item_value) end end CaptainHoog::Struct.new(config) end |