Class: Envirobly::Config
- Inherits:
-
Object
- Object
- Envirobly::Config
- Defined in:
- lib/envirobly/config.rb
Constant Summary collapse
- DIR =
".envirobly"
- PATH =
"#{DIR}/project.yml"
Instance Attribute Summary collapse
-
#parsing_error ⇒ Object
readonly
Returns the value of attribute parsing_error.
Instance Method Summary collapse
- #dig(*args) ⇒ Object
-
#initialize(commit) ⇒ Config
constructor
A new instance of Config.
- #parsing_error? ⇒ Boolean
- #path ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(commit) ⇒ Config
Returns a new instance of Config.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/envirobly/config.rb', line 11 def initialize(commit) @commit = commit @parsing_error = nil @project = parse_config_content_at_commit if @project transform_env_var_values! end end |
Instance Attribute Details
#parsing_error ⇒ Object (readonly)
Returns the value of attribute parsing_error.
9 10 11 |
# File 'lib/envirobly/config.rb', line 9 def parsing_error @parsing_error end |
Instance Method Details
#dig(*args) ⇒ Object
22 23 24 25 26 |
# File 'lib/envirobly/config.rb', line 22 def dig(*args) @project.dig *args rescue NoMethodError nil end |
#parsing_error? ⇒ Boolean
32 33 34 |
# File 'lib/envirobly/config.rb', line 32 def parsing_error? !@parsing_error.nil? end |
#path ⇒ Object
36 37 38 |
# File 'lib/envirobly/config.rb', line 36 def path PATH end |
#to_h ⇒ Object
28 29 30 |
# File 'lib/envirobly/config.rb', line 28 def to_h @project end |