lib/cotcube-bardata/helpers.rb
# small helper to select a specific full trading day from quarters (or reduced)
#   this special handling is needed, as full trading days start '5pm CT yesterday'
small helper to select a specific full trading day from quarters (or reduced)
this special handling is needed, as full trading days start '5pm CT yesterday'
small helper to select a specific full trading day from quarters ( or reduced ) this special handling is needed as full trading days start ' 5pm CT yesterday '
def select_specific_date(date:, base:)
      base.select do |d|
        d[:day] == date.day and date.year == d[:datetime].year and (
        if date.day > 1
          date.month == d[:datetime].month
        else
          ((date.month == d[:datetime].month     and d[:datetime].day == 1) or
           (date.month == d[:datetime].month + 1 and d[:datetime].day > 25))
        end
      )
      end
    end
def select_specific_date ( date : , base : ) base . select do | d | d [ :day ] == date . day and date . year == d [ :datetime ] . year and ( if date . day > 1 date . month == d [ :datetime ] . month else ( ( date . month == d [ :datetime ] . month and d [ :datetime ] . day == 1 ) or ( date . month == d [ :datetime ] . month + 1 and d [ :datetime ] . day > 25 ) ) end ) end end
small helper to select a specific full trading day from quarters (or reduced)
this special handling is needed, as full trading days start '5pm CT yesterday'
small helper to select a specific full trading day from quarters ( or reduced ) this special handling is needed as full trading days start ' 5pm CT yesterday '
date
<not_specific>
base
<not_specific>