predicates 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -2,24 +2,11 @@
2
2
 
3
3
  [Predicates](http://erol.github.com/predicates) are truth accessors for your Ruby classes and models. Yep, that's about it.
4
4
 
5
-
6
- ## Installation
7
-
8
- Add this line to your application's Gemfile:
9
-
10
- gem 'predicates'
11
-
12
- And then execute:
13
-
14
- $ bundle
15
-
16
- Or install it yourself as:
17
-
18
- $ gem install predicates
19
-
20
5
  ## Usage
21
6
 
22
- Include Predicates in your class or model and define the predicate by supplying an attribute:
7
+ Extend your class or model with Predicates and define the predicate by supplying an attribute:
8
+
9
+ require 'predicates'
23
10
 
24
11
  class User
25
12
  extend Predicates
@@ -44,6 +31,20 @@ Predicates will also create an attribute writer for you using `attr_writer` if t
44
31
  user.confirmed = 1
45
32
  user.confirmed? #=> true
46
33
 
34
+ ## Installation
35
+
36
+ Add this line to your application's Gemfile:
37
+
38
+ gem 'predicates'
39
+
40
+ And then execute:
41
+
42
+ $ bundle
43
+
44
+ Or install it yourself as:
45
+
46
+ $ gem install predicates
47
+
47
48
  ## Contributing
48
49
 
49
50
  1. Fork it
@@ -1,3 +1,3 @@
1
1
  module Predicates
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
data/lib/predicates.rb CHANGED
@@ -45,7 +45,7 @@ module Predicates
45
45
  attr_writer attribute unless method_defined? attribute
46
46
 
47
47
  define_method method do
48
- !!eval("@#{attribute}")
48
+ !!instance_variable_get(:"@#{attribute}")
49
49
  end
50
50
  end
51
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: predicates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-20 00:00:00.000000000 Z
12
+ date: 2012-09-24 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Truth accessors for Ruby classes and models.
15
15
  email: