File: nested_branches.rb

package info (click to toggle)
ruby-simplecov 0.22.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,500 kB
  • sloc: ruby: 5,550; makefile: 10
file content (15 lines) | stat: -rw-r--r-- 305 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# yes rubocop you are right but I want to test nesting!
# rubocop:disable Metrics/BlockNesting
module NestedBranches
  def self.call(arg)
    if arg.even?
      if arg == 42
        arg -= 1 while arg > 40
        :ok
      end
    else
      :nope
    end
  end
end
# rubocop:enable Metrics/BlockNesting