Class: Bridge::Bid
Overview
A Bid represents a statement of a level and a strain.
Instance Attribute Summary collapse
-
#level ⇒ Object
Returns the value of attribute level.
-
#strain ⇒ Object
Returns the value of attribute strain.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(level, strain) ⇒ Bid
constructor
A new instance of Bid.
- #to_s ⇒ Object
Methods inherited from Call
Constructor Details
Instance Attribute Details
#level ⇒ Object
Returns the value of attribute level.
66 67 68 |
# File 'lib/bridge/call.rb', line 66 def level @level end |
#strain ⇒ Object
Returns the value of attribute strain.
66 67 68 |
# File 'lib/bridge/call.rb', line 66 def strain @strain end |
Instance Method Details
#<=>(other) ⇒ Object
74 75 76 77 78 79 80 81 82 |
# File 'lib/bridge/call.rb', line 74 def <=>(other) if other.is_a?(Bid) # Compare two bids. s_size = Strain.values.size # puts "#{self.level*s_size + self.strain} <=> #{other.level*s_size + other.strain}" (self.level*s_size + self.strain) <=> (other.level*s_size + other.strain) else # Comparing non-bid calls returns true. 1 end end |