Sha256: 7d118381757acd1494a9e352aa48dbe5e950fdd9e17024332938387ef525dbfc

Contents?: true

Size: 1.41 KB

Versions: 13

Compression:

Stored size: 1.41 KB

Contents

module RulesEngine  
  module Publish
    
    autoload :DbPublisher, 'rules_engine/publish/publisher/db_publisher'
    
    class << self
      def publisher=(publisher_options)
        type, *parameters = *([ publisher_options ].flatten)

        case type
        when Symbol
          publisher_class_name = type.to_s.camelize
          publisher_class = RulesEngine::Publish.const_get(publisher_class_name)
          @publisher = publisher_class.new(*parameters)
        else
          @publisher = publisher_options
        end
      end

      def publisher
        throw "RulesEngine::Publish::Publisher required" unless @publisher
        @publisher
      end      
    end
    
    class Publisher
      # return the published version
      def publish(plan_code, version_tag, plan)
        throw "RulesEngine::Publish::Publisher required"
        # 1
      end
      
      # return the published plan_version
      def get(plan_code, plan_version = nil)
        throw "RulesEngine::Publish::Publisher required"
      end
      
      # list the published versions
      def history(plan_code, options = {})
        throw "RulesEngine::Publish::Publisher required"                
        # {
        #   :publications => []
        # }
      end

      # remove the plan
      def remove(plan_code, plan_version = nil)
        throw "RulesEngine::Publish::Publisher required"                
      end
      
    end  
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rules_engine-0.3.3 lib/rules_engine/publish/publisher.rb
rules_engine-0.3.2 lib/rules_engine/publish/publisher.rb
rules_engine-0.3.1 lib/rules_engine/publish/publisher.rb
rules_engine-0.3.0 lib/rules_engine/publish/publisher.rb
rules_engine-0.2.0 lib/rules_engine/publish/publisher.rb
rules_engine-0.1.10 lib/rules_engine/publish/publisher.rb
rules_engine-0.1.9 lib/rules_engine/publish/publisher.rb
rules_engine-0.1.8 lib/rules_engine/publish/publisher.rb
rules_engine-0.1.7 lib/rules_engine/publish/publisher.rb
rules_engine-0.1.6 lib/rules_engine/publish/publisher.rb
rules_engine-0.1.5 lib/rules_engine/publish/publisher.rb
rules_engine-0.1.4 lib/rules_engine/publish/publisher.rb
rules_engine-0.1.3 lib/rules_engine/publish/publisher.rb