metrix_db 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -28,8 +28,15 @@ Usage
28
28
  Query
29
29
  -----
30
30
 
31
- MyDB.where(:col1 => 1, :col2 => 2) # nil or instance of MyDB.
31
+ mydb = MyDB.where(:col1 => 1, :col2 => 2) # nil or instance of MyDB.
32
+ mydb.col1 # => 1
33
+ mydb.col2 # => 2
32
34
 
35
+ or alias :one
36
+
37
+ mydb = MyDB.on(:col1 => 1) # nil or instance of MyDB.
38
+ mydb.col1 # => 1
39
+ mydb.col2 # => 2
33
40
 
34
41
 
35
42
 
@@ -1,3 +1,3 @@
1
1
  module MetrixDb
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/metrix_db.rb CHANGED
@@ -34,5 +34,6 @@ module MetrixDB
34
34
  end
35
35
  end
36
36
  end
37
+ alias :on :where
37
38
  end
38
39
  end
@@ -32,6 +32,12 @@ describe MetrixDB do
32
32
  inst.col1.should == 1
33
33
  inst.col2.should == 2
34
34
  end
35
+
36
+ it "should alias :on to :where" do
37
+ inst = @class.on(:col2 => 2)
38
+ inst.col1.should == 1
39
+ inst.col2.should == 2
40
+ end
35
41
  end
36
42
  end
37
43
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metrix_db
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Allen Wei
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-08 00:00:00 +08:00
18
+ date: 2011-03-09 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency