module NBP::Commons

Constants

CORE_WEB_PATH

Public Class Methods

extended(base) click to toggle source
# File lib/nbp/commons.rb, line 4
def self.extended(base)
  base.private_class_method :normalize_time_period
end

Public Instance Methods

nbp_date_format_hash(date) click to toggle source
# File lib/nbp/commons.rb, line 8
def nbp_date_format_hash(date)
  day =  normalize_time_period date.day.to_s
  month = normalize_time_period date.month.to_s
  year = date.year.to_s[-2..-1]
  { day: day, month: month, year: year }
end

Private Instance Methods

normalize_time_period(number_word) click to toggle source
# File lib/nbp/commons.rb, line 17
def normalize_time_period(number_word)
  number_word.size == 1 ? '0' + number_word : number_word
end