attr-utils 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/README.md +13 -0
- data/lib/attr-utils/attr_list.rb +12 -0
- data/lib/attr-utils/version.rb +4 -0
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dfcdf7d3332466c264e7b904093e2aa671d9ac851011380e640deafb6a24676
|
4
|
+
data.tar.gz: bbd619d4a9e90f7f224393184e2e976378b6144216eea8962acc19aa6b85531b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d31da796d6cbc939dbbb5fb210add6baeb031edd1c9cf684574ef77fb06726293b7ec56621cfe74f85cb469e45d679de9e1ba176d3533b51120449f8e9e0ee4
|
7
|
+
data.tar.gz: 20cd1e9a37f0acd48e5174e3c871895233605e512b66857d1e84455c5d1693d3ed429f1dc9d7566fb8fac1b7a560a15cfd301df38553ff16a31beb751e7b7a38
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2020 Shota Morimoto
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
module AttrUtils
|
2
|
+
module AttrList
|
3
|
+
# Return attributes' name which has getter and setter methods in the class.
|
4
|
+
# Hopefully they may identical with attributes defined as "attr_accessor".
|
5
|
+
#
|
6
|
+
# @return [Array<Symbol>]
|
7
|
+
def list_attr_accessors
|
8
|
+
methods = instance_methods - %w(== === !=).map(&:to_sym)
|
9
|
+
methods.select{|m| methods.find{|m2| "#{m.to_s}=" == m2.to_s } }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attr-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shota Morimoto
|
@@ -16,7 +16,11 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
+
- LICENSE
|
20
|
+
- README.md
|
19
21
|
- lib/attr-utils.rb
|
22
|
+
- lib/attr-utils/attr_list.rb
|
23
|
+
- lib/attr-utils/version.rb
|
20
24
|
homepage: https://twitter.com/shoutm
|
21
25
|
licenses:
|
22
26
|
- MIT
|