Understanding Boolean Methods in Ruby With Examples

Written by SELMAe33 | Published 2020/02/12
Tech Story Tags: ruby | ruby-methods | boolean_methods | programming | mathematics | tutorial | beginners | software-development | web-monetization

TLDR Ruby language does not have a Data Type called “Boolean” This is a form of data with only two possible values (usually “true” and “false”) Ruby has a Boolean Data Type, otherwise called Predicates or Query. These are methods that end with a question mark (?) These are called 'Boolean Methods' Ruby's all? method returns true if the block never returns false or nil. If the block is not given, Ruby adds an implicit block of { |obj| obj } which will cause all? to return true when none of the collection members are false.via the TL;DR App

no story

Written by SELMAe33 | Full Stack Developer
Published by HackerNoon on 2020/02/12