Class: DateTime
- Inherits:
-
Object
- Object
- DateTime
- Defined in:
- lib/time_extended.rb
Overview
Extend and simplify Ruby class ‘DateTime`
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/time_extended.rb', line 3 def method_missing(method) = '' params = method.to_s.split('') params.each do |el| = "#{}#{el}" = "#{} " if ('a'..'z').include?(el) || ('A'..'Z').include?(el) end = "%#{.split(' ').join(' %')}" self.class.send(:define_method, method) { strftime() } strftime() end |