has_attributes 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.md CHANGED
@@ -1,3 +1,9 @@
1
+ 0.0.2 / 2014-02-03
2
+ ==================
3
+
4
+ * Use public_send for public instance methods
5
+
6
+
1
7
  0.0.1 / 2014-02-03
2
8
  ==================
3
9
 
data/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  has_attributes is a ruby gem which provides a module for extending your classes with simple methods for creating elegant plain-ruby models.
4
4
 
5
+ ```
6
+ gem install has_attributes
7
+ ```
8
+
5
9
  ## API
6
10
 
7
11
  has_attributes delivers the following class and instance methods:
@@ -1,3 +1,3 @@
1
1
  module HasAttributes
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -38,13 +38,13 @@ module HasAttributes
38
38
  end
39
39
 
40
40
  def attributes=(attrs)
41
- self.class.model_attributes.each {|attr| send((attr.to_s << "=").to_sym, attrs[attr])}
41
+ self.class.model_attributes.each {|attr| public_send((attr.to_s << "=").to_sym, attrs[attr])}
42
42
  attributes
43
43
  end
44
44
 
45
45
  def attributes
46
46
  self.class.model_attributes.reduce({}) do |memo, attr|
47
- memo.merge(attr => send(attr))
47
+ memo.merge(attr => public_send(attr))
48
48
  end
49
49
  end
50
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
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: 2014-02-04 00:00:00.000000000 Z
12
+ date: 2014-02-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler