class_attribute 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/README.md +1 -1
- data/lib/class_attribute/version.rb +1 -1
- data/lib/class_attribute.rb +7 -5
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66a02e69a422172ca4afaadaae114e9aaf5bbb03
|
4
|
+
data.tar.gz: 1f8d902717ce2b22ea65af3ab7e9f8269179804c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbafc1c0788f4e0711d6cc3d9ac0951d42ca4ca3e3054ab960ba585ac67d0e404f7994e7293c0094b7e95b7b367e26eac311eba4bf15a6920e67caa00f1bc8ab
|
7
|
+
data.tar.gz: a3ffdb588bab4c1444f7abd9d886705745eae157b7376afa193ebcce0ae3fcb6b0cbe1cf26ce7d234b50d5b1bb4c4550c8511301c2f29a07e63c275eb15207a3
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# ClassAttribute
|
2
2
|
|
3
|
-
Inheritable class level variable accessors
|
3
|
+
Inheritable class level variable accessors. Originally extracted from the Lotus project.
|
4
4
|
|
5
5
|
## Status
|
6
6
|
[![Coverage Status](https://coveralls.io/repos/sandelius/class_attribute/badge.svg?branch=master)](https://coveralls.io/r/sandelius/class_attribute?branch=master)
|
data/lib/class_attribute.rb
CHANGED
@@ -1,14 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'set'
|
2
4
|
|
3
5
|
require_relative 'class_attribute/version'
|
4
6
|
|
5
7
|
# Inheritable class level variable accessors.
|
6
8
|
#
|
9
|
+
# @author Luca Guidi
|
7
10
|
# @author Tobias Sandelius <tobias@sandeli.us>
|
8
11
|
#
|
9
12
|
# @see ClassAttribute::ClassMethods#class_attribute
|
10
13
|
module ClassAttribute
|
11
|
-
# @
|
14
|
+
# @private
|
12
15
|
# @see http://www.ruby-doc.org/core/Module.html#method-i-included
|
13
16
|
def self.included(base)
|
14
17
|
base.extend ClassMethods
|
@@ -55,7 +58,7 @@ module ClassAttribute
|
|
55
58
|
# @return [void]
|
56
59
|
def class_attribute(*attrs)
|
57
60
|
singleton_class.class_eval do
|
58
|
-
attr_accessor
|
61
|
+
attr_accessor(*attrs)
|
59
62
|
end
|
60
63
|
|
61
64
|
class_attributes.merge(attrs)
|
@@ -64,7 +67,7 @@ module ClassAttribute
|
|
64
67
|
protected
|
65
68
|
|
66
69
|
# @private
|
67
|
-
# @see Class#inherited
|
70
|
+
# @see http://ruby-doc.org/core/Class.html#method-i-inherited
|
68
71
|
def inherited(subclass)
|
69
72
|
class_attributes.each do |attr|
|
70
73
|
value = send(attr)
|
@@ -78,8 +81,7 @@ module ClassAttribute
|
|
78
81
|
|
79
82
|
private
|
80
83
|
|
81
|
-
# @
|
82
|
-
# @see http://ruby-doc.org/core-2.2.2/Class.html#method-i-inherited
|
84
|
+
# @private
|
83
85
|
def class_attributes
|
84
86
|
@class_attributes ||= ::Set.new
|
85
87
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: class_attribute
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Sandelius
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -119,10 +119,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
121
|
rubyforge_project:
|
122
|
-
rubygems_version: 2.
|
122
|
+
rubygems_version: 2.5.1
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: Inheritable class level variable accessors
|
126
126
|
test_files:
|
127
127
|
- test/test_helper.rb
|
128
128
|
- test/unit/class_attribute_test.rb
|
129
|
+
has_rdoc:
|