aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/bin
diff options
context:
space:
mode:
authorGravatar Aggelos Avgerinos <evaggelos.avgerinos@gmail.com>2015-05-09 13:08:03 +0300
committerGravatar Aggelos Avgerinos <evaggelos.avgerinos@gmail.com>2015-05-09 13:08:03 +0300
commit57e7dc8e8dbc9ac55d5491d7d956f6981e4d3a94 (patch)
treec953d411954c438c01e48ca4cddd69b24569ba03 /src/ruby/bin
parentcc193a66661eea897a53d16b0cd4054a338f9c9b (diff)
Ruby style changes: replace `== 0` with `zero?`
Diffstat (limited to 'src/ruby/bin')
-rwxr-xr-xsrc/ruby/bin/math_server.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ruby/bin/math_server.rb b/src/ruby/bin/math_server.rb
index 1bfe253b85..e46d9c671f 100755
--- a/src/ruby/bin/math_server.rb
+++ b/src/ruby/bin/math_server.rb
@@ -55,7 +55,7 @@ class Fibber
return enum_for(:generator) unless block_given?
idx, current, previous = 0, 1, 1
until idx == @limit
- if idx == 0 || idx == 1
+ if idx.zero? || idx == 1
yield Math::Num.new(num: 1)
idx += 1
next
@@ -94,7 +94,7 @@ end
# package. That practice should be avoided by defining real services.
class Calculator < Math::Math::Service
def div(div_args, _call)
- if div_args.divisor == 0
+ if div_args.divisor.zero?
# To send non-OK status handlers raise a StatusError with the code and
# and detail they want sent as a Status.
fail GRPC::StatusError.new(GRPC::Status::INVALID_ARGUMENT,