Class: SurroGate::Pair
- Inherits:
-
Object
- Object
- SurroGate::Pair
- Defined in:
- lib/surro-gate/pair.rb
Instance Attribute Summary collapse
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Instance Method Summary collapse
-
#initialize(left, right) ⇒ Pair
constructor
A new instance of Pair.
- #ready? ⇒ Boolean
Constructor Details
#initialize(left, right) ⇒ Pair
Returns a new instance of Pair.
7 8 9 10 11 |
# File 'lib/surro-gate/pair.rb', line 7 def initialize(left, right) @left = left @right = right @rd_rdy = @wr_rdy = false end |
Instance Attribute Details
#left ⇒ Object (readonly)
Returns the value of attribute left.
5 6 7 |
# File 'lib/surro-gate/pair.rb', line 5 def left @left end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
5 6 7 |
# File 'lib/surro-gate/pair.rb', line 5 def right @right end |
Instance Method Details
#ready? ⇒ Boolean
13 14 15 |
# File 'lib/surro-gate/pair.rb', line 13 def ready? @rd_rdy && @wr_rdy || @left.closed? || @right.closed? end |