Skip to content

Instantly share code, notes, and snippets.

@YumaInaura
Last active December 31, 2015 06:57
Show Gist options
  • Select an option

  • Save YumaInaura/002e644555f9733670c3 to your computer and use it in GitHub Desktop.

Select an option

Save YumaInaura/002e644555f9733670c3 to your computer and use it in GitHub Desktop.
Ruby | true と false を反転させる方法 ref: http://qiita.com/Yinaura/items/9df95ec1ff496f28387d
!(true)
# => false
!(false)
# => true
class Person
def is_man?
if is_woman
return false
else
return true
end
end
end
class Person
def is_man?
!(is_woman?)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment