require 'active_support/core_ext/module' module Pears module Providers class Builder delegate :name, to: :subject def initialize(subject) @subject = subject end def hash raise 'not yet implemented' end def loco raise 'not yet implemented' end def env raise 'not yet implemented' end def local_file(file_path) register Provider::LocalFile.new(file_path) end def remote_file(file_url) register Provider::RemoteFile.new(file_url) end def subscription &block register Provider::Subscription.new(@subject.name, &block) end private def register provider return provider unless @subject.is_a? Subject @subject.push_layer provider end end end end