class Object
Public Instance Methods
making_available_for_strftime(elements)
click to toggle source
# File lib/time_updater.rb, line 13 def making_available_for_strftime(elements) elements.each_with_index.inject('') do |str, (elem, num)| str << if num > 0 && elements[num - 1] !~ /\D/ elem else " %" + elem end end end
method_missing(args)
click to toggle source
unavailable_elements = ['E','f','i','J','K','o','O','q','Q']
# File lib/time_updater.rb, line 6 def method_missing args elements = args.to_s.split(//) str = making_available_for_strftime(elements) puts strftime(str).green end