Permalink
Browse files

Changed Date pattern implementation to use bean-match

  • Loading branch information...
frenchy64 committed Sep 1, 2011
1 parent 830cb50 commit 86128c9919d7f55a464b9b5028636dd59232ea83
Showing with 2 additions and 19 deletions.
  1. +2 −19 src/match/date.clj
View
@@ -1,21 +1,4 @@
(ns match.date
- (:use [match.core :only [IMatchLookup]]))
+ (:use [match.java :only [bean-match]]))
-(extend-type java.util.Date
- IMatchLookup
- (val-at* [this k not-found]
- (case k
- :year (.getYear this)
- :month (.getMonth this)
- :date (.getDate this)
- :hours (.getHours this)
- :minutes (.getMinutes this)
- not-found)))
-
-
-;; Example implementation using clojure.core/bean
-(comment
- (extend-type java.util.Date
- IMatchLookup
- (val-at* [this k not-found]
- (get (bean this) k not-found))))
+(bean-match java.util.Date)

0 comments on commit 86128c9

Please sign in to comment.