Sha256: b736a2f9a8c55b8ab7851b4144657d67a314e030bac84d045e66e00a096b5eba

Contents?: true

Size: 547 Bytes

Versions: 3

Compression:

Stored size: 547 Bytes

Contents

# frozen_string_literal: true
require 'dry-configurable'
require_relative "pears/version"
require_relative "pears/errors"
require_relative "pears/provider"
require_relative "pears/subject"

module Pears
  extend Dry::Configurable

  setting :redis_host, default: :localhost

  def self.subjects
    @subjects ||= []
  end

  # This is the main way of locating a subject.
  def self.subject(name)
    subjects
    Subject.new(name).tap do |subject|
      builder = Provider::Builder.new(subject)
      @subjects << yield(builder)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pears-0.2.0 lib/pears.rb
pears-0.1.4 lib/pears.rb
pears-0.1.3 lib/pears.rb