Sha256: 132aff8b7494df1c1efa63234cb744a6189fd07f1beb43a8410d08a3e347e600

Contents?: true

Size: 555 Bytes

Versions: 1

Compression:

Stored size: 555 Bytes

Contents

# frozen_string_literal: true

require "active_loader/version"
require "active_loader/content_loader"
require "active_loader/loader_dispatcher"

module ActiveLoader
  def self.load(path, type:)
    meta_load(path, type)
  end

  def self.yaml(path)
    meta_load(path, :yaml)
  end
  singleton_class.send :alias_method, :yml, :yaml

  def self.json(path)
    meta_load(path, :json)
  end

  def self.meta_load(path, type)
    content = ContentLoader.new(path).call

    LoaderDispatcher.new(content, type).call
  end
  private_class_method :meta_load
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_loader-1.0.0 lib/active_loader.rb