Class: MiniKraken::Core::Bookmark
- Inherits:
-
Object
- Object
- MiniKraken::Core::Bookmark
- Defined in:
- lib/mini_kraken/core/bookmark.rb
Overview
A bookmark is a placeholder for events of significance for manipulating the move queue of a blackboard. The events that involve bookmarks are:
-
enter_scope (when executing fresh expression)
-
leave_scope (when all solutions for given scope were found)
-
add_bt_point (when a backtrack point must be added)
-
remove_bt_point (when a backtrack point must be retracted)
-
next_alternative (when an alternative solution is searched)
-
fail! (when the current solution fails)
Instance Attribute Summary collapse
-
#kind ⇒ Symbol
readonly
One of: :scope, :bt_point.
-
#ser_num ⇒ Integer
readonly
An unique serial number.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Equality comparison return [Boolean].
-
#initialize(aKind, aSerialNumber) ⇒ Bookmark
constructor
A new instance of Bookmark.
Constructor Details
#initialize(aKind, aSerialNumber) ⇒ Bookmark
Returns a new instance of Bookmark.
23 24 25 26 |
# File 'lib/mini_kraken/core/bookmark.rb', line 23 def initialize(aKind, aSerialNumber) @kind = validated_kind(aKind) @ser_num = aSerialNumber end |
Instance Attribute Details
#kind ⇒ Symbol (readonly)
Returns One of: :scope, :bt_point.
16 17 18 |
# File 'lib/mini_kraken/core/bookmark.rb', line 16 def kind @kind end |
#ser_num ⇒ Integer (readonly)
Returns An unique serial number.
19 20 21 |
# File 'lib/mini_kraken/core/bookmark.rb', line 19 def ser_num @ser_num end |
Instance Method Details
#==(other) ⇒ Object
Equality comparison return [Boolean]
31 32 33 |
# File 'lib/mini_kraken/core/bookmark.rb', line 31 def ==(other) ser_num == other.ser_num end |