Create a gist now

Instantly share code, notes, and snippets.

@tai2 /a.rb
Created Sep 20, 2016

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