valim 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +3 -3
  2. data/lib/valim.rb +50 -0
  3. metadata +3 -3
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  Adds Valimisms to your ruby
2
2
 
3
- def code_is_awesome
4
- confirm
5
- end
3
+ def code_is_awesome
4
+ confirm
5
+ end
data/lib/valim.rb CHANGED
@@ -1,4 +1,12 @@
1
1
  module Kernel
2
+ def confirm?
3
+ true
4
+ end
5
+
6
+ def deny?
7
+ false
8
+ end
9
+
2
10
  def confirm
3
11
  true
4
12
  end
@@ -6,4 +14,46 @@ module Kernel
6
14
  def deny
7
15
  false
8
16
  end
17
+
18
+ def confirm_deny?
19
+ confirm?
20
+ end
21
+ end
22
+
23
+ module Valim
24
+ module Denied
25
+ def confirm?
26
+ false
27
+ end
28
+
29
+ def deny?
30
+ true
31
+ end
32
+ end
33
+ end
34
+
35
+ class NilClass
36
+ include Valim::Denied
37
+ end
38
+
39
+ class FalseClass
40
+ include Valim::Denied
41
+
42
+ def inspect
43
+ "deny"
44
+ end
45
+
46
+ def to_s
47
+ "deny"
48
+ end
49
+ end
50
+
51
+ class TrueClass
52
+ def inspect
53
+ "confirm"
54
+ end
55
+
56
+ def to_s
57
+ "confirm"
58
+ end
9
59
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valim
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
  - Carl Lerche