Module: Rubylog

Extended by:
Tracing
Defined in:
lib/rubylog.rb,
lib/rubylog/rule.rb,
lib/rubylog/errors.rb,
lib/rubylog/tracing.rb,
lib/rubylog/variable.rb,
lib/rubylog/predicate.rb,
lib/rubylog/primitive.rb,
lib/rubylog/procedure.rb,
lib/rubylog/structure.rb,
lib/rubylog/rubylog_files.rb,
lib/rubylog/dsl/primitives.rb,
lib/rubylog/default_context.rb,
lib/rubylog/context_creation.rb,
lib/rubylog/nullary_predicates.rb,
lib/rubylog/context_modules/predicates.rb

Overview

rubylog – Prolog workalike for Ruby github.com/cie/rubylog

Defined Under Namespace

Modules: Assertable, CompoundTerm, Context, ContextModules, DSL, DefaultContext, Goal, RSpecExampleGroup, RubylogFiles, Term, Tracing Classes: CheckFailed, ExistenceError, InstantiationError, InvalidStateError, Predicate, Primitive, Procedure, RubylogError, Rule, Structure, SyntaxError, Variable

Constant Summary collapse

NullaryPredicates =
{}

Instance Attribute Summary

Attributes included from Tracing

#trace_levels, #traceable_methods

Class Method Summary collapse

Methods included from Tracing

trace, trace?, traceable

Class Method Details

.create_context(source_object = Object.new) ⇒ Object

Creates a new context from a new object or optionally from an existing source object

Returns:

  • the new context



6
7
8
9
10
11
# File 'lib/rubylog/context_creation.rb', line 6

def self.create_context source_object=Object.new
  class << source_object
    include Rubylog::Context
  end
  source_object
end