Class: Fix::Expectation
- Inherits:
-
Object
- Object
- Fix::Expectation
- Includes:
- Spectus::DSL
- Defined in:
- lib/fix/expectation.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(object, positive, definition, *args) ⇒ Expectation
constructor
A new instance of Expectation.
Constructor Details
#initialize(object, positive, definition, *args) ⇒ Expectation
Returns a new instance of Expectation.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fix/expectation.rb', line 12 def initialize object, positive, definition, *args @positive = positive @definition = definition @args = args @priority = DB.instance.random.rand freeze DB.instance.update(object => SortedSet[]) unless DB.instance.key? object DB.instance.fetch(object).add self end |
Instance Attribute Details
#priority ⇒ Object (readonly)
Returns the value of attribute priority.
10 11 12 |
# File 'lib/fix/expectation.rb', line 10 def priority @priority end |
Instance Method Details
#<=>(other) ⇒ Object
24 25 26 |
# File 'lib/fix/expectation.rb', line 24 def <=> other self.priority <=> other.priority end |