Skip to content
  • Xavier Noria's avatar
    126dc476
    blank? and present? commit to return singletons [Xavier Noria & Pavel Pravosud] · 126dc476
    Xavier Noria authored
    The contract of blank? and present? was in principle to return Object, as we
    generally do, the test suite and description was consistent with that, but some
    examples had comments like "# => true".
    
    This cannot be unclear, we either fix the examples, or update the contract.
    
    Since users may be already assuming singletons due to the examples and the fact
    that they were returned before 30ba7ee5, the safest option seems to be to revise
    the contract and the implementation of String#blank?
    
    The motivation for 30ba7ee5 was to improve the performance of the predicate, the
    refactor based on === is on par regarding speed.
    
    With this commit we start documenting return types using YARD conventions. We
    plan to document return types gradually.
    126dc476
    blank? and present? commit to return singletons [Xavier Noria & Pavel Pravosud]
    Xavier Noria authored
    The contract of blank? and present? was in principle to return Object, as we
    generally do, the test suite and description was consistent with that, but some
    examples had comments like "# => true".
    
    This cannot be unclear, we either fix the examples, or update the contract.
    
    Since users may be already assuming singletons due to the examples and the fact
    that they were returned before 30ba7ee5, the safest option seems to be to revise
    the contract and the implementation of String#blank?
    
    The motivation for 30ba7ee5 was to improve the performance of the predicate, the
    refactor based on === is on par regarding speed.
    
    With this commit we start documenting return types using YARD conventions. We
    plan to document return types gradually.
Loading