Skip to content
0
  • Home
  • Piero Bosio
  • Blog
  • World
  • Fediverso
  • News
  • Categories
  • Old Web Site
  • Recent
  • Popular
  • Tags
  • Users
  • Home
  • Piero Bosio
  • Blog
  • World
  • Fediverso
  • News
  • Categories
  • Old Web Site
  • Recent
  • Popular
  • Tags
  • Users
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Piero Bosio Social Web Site Personale Logo Fediverso

Social Forum federato con il resto del mondo. Non contano le istanze, contano le persone
veganstraightedge@ruby.socialundefined

Shane Becker

@veganstraightedge@ruby.social
About
Posts
2
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

View Original

Posts

Recent Best Controversial

  • The four common number checks we do are:
    veganstraightedge@ruby.socialundefined veganstraightedge@ruby.social

    The four common number checks we do are:

    negative, zero, one, many

    In #Ruby, we have…

    num = 123

    num.negative? #=> false
    num.zero? #=> false
    num.positive? #=> true

    num > 1 #=> true

    IMO, it feels like Numeric needs a method for “positive and more than one”

    .many? .plural? something like that

    Uncategorized ruby

  • I'm always surprised when #Ruby doesn't have an antonym method for a predicate method.[].empty?#=> true![]
    veganstraightedge@ruby.socialundefined veganstraightedge@ruby.social

    I'm always surprised when #Ruby doesn't have an antonym method for a predicate method.

    [].empty?
    #=> true

    ![].empty?
    #=> false

    ———

    I know of [].any?
    But that's not what I'd expect as an opposite of `empty?`

    I understand why #Rails have `.present?` and `.blank?`

    Am I missing something in Ruby?

    Uncategorized ruby rails
  • Login

  • Login or register to search.
  • First post
    Last post