Sha256: 745d0a5391d401c0e859af541ba0a3d938a2dea71d104e7a1ec5768739d754f3

Contents?: true

Size: 741 Bytes

Versions: 2

Compression:

Stored size: 741 Bytes

Contents

require "optionally"
require "smart_aleck/version"
require 'smart_aleck/category_indexer'
require 'smart_aleck/entry_creator'
require 'smart_aleck/finding_viable_peers'

module SmartAleck
  include Optionally::Required

  def self.configure(options)
    check_required_options(options, :category_model, :entry_model)
    @category_model = options[:category_model]
    @entry_model = options[:entry_model]
  end

  def self.category_model
    @category_model
  end

  def self.entry_model
    @entry_model
  end

  def self.verify_configured
    raise NotConfigured unless (category_model && entry_model)
    true
  end

  def self.clear_config!
    @entry_model = @category_model = nil
  end

  class NotConfigured < StandardError
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
smart_aleck-0.1.0 lib/smart_aleck.rb
smart_aleck-0.0.1 lib/smart_aleck.rb