Class: GhostAdapter::Config

Inherits:
Struct
  • Object
show all
Defined in:
lib/ghost_adapter/config.rb

Instance Method Summary collapse

Instance Method Details

#as_args(context: {}) ⇒ Object



100
101
102
103
# File 'lib/ghost_adapter/config.rb', line 100

def as_args(context: {})
  full_context = context.merge(compact)
  with_env.map { |key, value| arg(key, value, full_context) }.compact
end

#compactObject



96
97
98
# File 'lib/ghost_adapter/config.rb', line 96

def compact
  to_h.compact
end

#merge!(other_config) ⇒ Object



86
87
88
89
# File 'lib/ghost_adapter/config.rb', line 86

def merge!(other_config)
  other_config.compact.each { |k, v| self[k] = v }
  self
end

#with_envObject



91
92
93
94
# File 'lib/ghost_adapter/config.rb', line 91

def with_env
  env_config = EnvParser.new(ENV).config
  compact.merge(env_config)
end