Skip to content

Instantly share code, notes, and snippets.

@tai2
Created September 20, 2016 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tai2/6a53fb8953ecb48c7a0e547eeba2b2bf to your computer and use it in GitHub Desktop.
Save tai2/6a53fb8953ecb48c7a0e547eeba2b2bf to your computer and use it in GitHub Desktop.
unless considered harmful
class Muto
def initialize(sniper)
@sniper = sniper
end
def with_sniper?
@sniper
end
def without_sniper?
!@sniper
end
end
mu10 = Muto.new(true)
# no
if !mu10.with_sniper?
puts 'yes'
else
puts 'no'
end
# yes
unless mu10.without_sniper?
puts 'yes'
else
puts 'no'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment