Class: Sequel::Funky::FunkyBase
- Inherits:
-
Object
- Object
- Sequel::Funky::FunkyBase
- Defined in:
- lib/sequel/extensions/funky.rb
Direct Known Subclasses
Instance Method Summary collapse
- #from_strptime(format) ⇒ Object
-
#initialize(db) ⇒ FunkyBase
constructor
A new instance of FunkyBase.
- #to_strptime(format) ⇒ Object
Constructor Details
#initialize(db) ⇒ FunkyBase
Returns a new instance of FunkyBase.
7 8 9 |
# File 'lib/sequel/extensions/funky.rb', line 7 def initialize(db) @db = db end |
Instance Method Details
#from_strptime(format) ⇒ Object
17 18 19 20 21 |
# File 'lib/sequel/extensions/funky.rb', line 17 def from_strptime(format) return format unless format =~ /%/ format.gsub('%Y', 'yyyy').gsub('%m', 'MM').gsub('%d', 'dd') end |
#to_strptime(format) ⇒ Object
11 12 13 14 15 |
# File 'lib/sequel/extensions/funky.rb', line 11 def to_strptime(format) return format if format =~ /%/ format.gsub('yyyy', '%Y').gsub('MM', '%m').gsub('dd', '%d') end |