class Boechat::Core::Config::Reader

Class responsible for read the boechat.yml file, that describes all endpoints to call

Attributes

config_path[R]

Public Class Methods

new() click to toggle source
# File lib/boechat/core/config/reader.rb, line 14
def initialize
  app_root = Pathname.new(File.expand_path('../../../../', __dir__))
  @config_path = File.join(app_root, 'config', 'boechat.yml')
end

Public Instance Methods

call() click to toggle source
# File lib/boechat/core/config/reader.rb, line 19
def call
  result = validate_config_schema
  output = result.success? ? result.output : {}
  Wrapper.new(output, result.errors)
end

Private Instance Methods

validate_config_schema() click to toggle source
# File lib/boechat/core/config/reader.rb, line 27
def validate_config_schema
  SchemaValidator.call(File.read(@config_path))
end