Module: Porkadot::ConfigUtils

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



117
118
119
120
# File 'lib/porkadot/config.rb', line 117

def method_missing name, *args
  return nil if self.raw.nil?
  self.raw[name]
end

Instance Method Details

#asset_path(file) ⇒ Object Also known as: path



108
109
110
# File 'lib/porkadot/config.rb', line 108

def asset_path file
  File.join(self.target_path, file.to_s)
end

#configObject



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

def config
  return @config
end

#loggerObject



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

def logger
  return @config.logger
end

#rawObject



104
105
106
# File 'lib/porkadot/config.rb', line 104

def raw
  return @raw
end

#respond_to_missing?(sym, include_private) ⇒ Boolean

Returns:

  • (Boolean)


122
123
124
125
# File 'lib/porkadot/config.rb', line 122

def respond_to_missing? sym, include_private
  return false if self.raw.nil?
  self.raw.respond_to_missing?(sym, include_private) ? true : super
end

#secrets_path(file) ⇒ Object



113
114
115
# File 'lib/porkadot/config.rb', line 113

def secrets_path file
  File.join(self.target_secrets_path, file.to_s)
end