lib/bridge/score.rb in bridge-0.0.26 vs lib/bridge/score.rb in bridge-0.1.0

- old
+ new

@@ -1,8 +1,9 @@ module Bridge class Score attr_reader :tricks, :contract, :vulnerable + alias :vulnerable? :vulnerable # Checks contract with result, i.e. "1NTX-1", "2S=", "6SXX+1" # on Ruby >= 1.9 there are named groups :contract and :result # on Ruby < 1.9 there are: contract on $1 and result on $5 if RUBY_VERSION >= "1.9" @@ -53,13 +54,9 @@ contracts = all_contracts.select { |contract, result| result == points } contracts.respond_to?(:keys) ? contracts.keys.sort : contracts.map { |c| c.first }.sort # Ruby 1.8.* compatibility end # private - - def vulnerable? - @vulnerable == true - end def tricks_to_make_contract contract.level.to_i + 6 end