class
VirtualDate::Explanation
- VirtualDate::Explanation
- Reference
- Object
Overview
Holds a buffer of string explanations, for scheduling etc.
This is a reference type on purpose: a Candidate hands its buffer to the
Scheduled it turns into, and both go on appending to the same buffer.
Defined in:
virtualdate.crConstant Summary
-
MAX_LINES =
100 -
Maximum number of messages kept. Once reached, the penultimate line gives way to a notice of how many were dropped.
Constructors
Instance Method Summary
-
#add(msg : String) : Bool
Appends
msg, and returns whether the buffer still had room for it. -
#dropped : Int32
How many messages have been dropped for want of room
-
#lines : Array(String)
Read-only:
#addmaintains the size invariant the overflow handling below relies on, and an externally assigned short array would break it. -
#to_s(io : IO) : Nil
Appends a short String representation of this object which includes its class name and its object address.
Constructor Detail
Instance Method Detail
Appends msg, and returns whether the buffer still had room for it.
Once it is full the most recent message is kept in place of the previous one, rather than dropped: the last thing said about a candidate is its verdict, and for a vdate scheduled over a conflict because dependents require it, that line is the only thing telling a deliberate over-subscription apart from a scheduling fault.
Read-only: #add maintains the size invariant the overflow handling
below relies on, and an externally assigned short array would break it.
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>