attr-utils 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 866735d11c1a49e18ad5dc39e1aca9b62a753712f474408631e49bfb5bdfa457
4
- data.tar.gz: 85f6c856620239a2028ef350d150d3253ffd66ca54e9736df269342c72e79782
3
+ metadata.gz: 2dfcdf7d3332466c264e7b904093e2aa671d9ac851011380e640deafb6a24676
4
+ data.tar.gz: bbd619d4a9e90f7f224393184e2e976378b6144216eea8962acc19aa6b85531b
5
5
  SHA512:
6
- metadata.gz: d74185b89ac2d64494b2e41c66984ca81a7fe7becdff77eafe0c9fa916c8ab642ed1ab3f95779df690d42f290d02cf3aa144c88fc225cd42b4f0dcdf1f4efef7
7
- data.tar.gz: fb04705745b848fa61a5e406fccf755190bb81bf765df7cf1ee66a6c96598b3ad60c17a9440d345f9917fd3bd8761c1e23a2a3be2f09c8386ddab8aa6c7f4b08
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,13 @@
1
+ # AttrUtils
2
+ Utilities of class attributes in Ruby language
3
+
4
+ ## Usage
5
+ Just require and extend AttrUtils whereever you want.
6
+
7
+ ```
8
+ require 'attr-utils'
9
+
10
+ class Test
11
+ extend AttrUtils
12
+ end
13
+ ```
@@ -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
@@ -0,0 +1,4 @@
1
+ module AttrUtils
2
+ Version = '0.1.1'
3
+ end
4
+
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.0
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