abstracts 0.0.0 → 1.0.0
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 +4 -4
- data/lib/abstracts.rb +7 -7
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb35e8f5f23bff2fc6ebcdd10eb9fd548d939880
|
4
|
+
data.tar.gz: 80c3c1506917a78da8a9651618105e2ba0857d65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3600d8554add3c70425f6d4aac7be1b8a60cd1f6f7b3264daefd35c228763ce1b0f42cf1d058517bd58e08b8b481776a6a5f37e7fbbf14d3154a9cc3c897acbd
|
7
|
+
data.tar.gz: d3d1a2392504f1ab1ff29c7db75dba78286acb7f4816a8942ab00669bb87abf06ed72357a651ddfac2a954214da69ffb240a1509c9e963b70e6ab62bc909b140
|
data/lib/abstracts.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Abstract module: have to be moved somewhere to core
|
2
2
|
module Abstract
|
3
|
-
#
|
3
|
+
# Abstract::Object class
|
4
4
|
class Object
|
5
5
|
# Get an array of attr_accessor names besides class name itself
|
6
6
|
# @return [Array] - Array of attribute accessor methods
|
@@ -13,13 +13,13 @@ module Abstract
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
#
|
16
|
+
# Abstract::Builder class
|
17
17
|
class Builder
|
18
18
|
attr_reader :object,
|
19
19
|
:attrs
|
20
20
|
|
21
|
-
# Create an instance of
|
22
|
-
# @return @object [AbstractObject] -
|
21
|
+
# Create an instance of Abstract::Object class and yield block to it
|
22
|
+
# @return @object [AbstractObject] - Abstract::Object class instance
|
23
23
|
def self.build
|
24
24
|
builder = new(@build_class)
|
25
25
|
yield builder if block_given?
|
@@ -27,9 +27,9 @@ module Abstract
|
|
27
27
|
end
|
28
28
|
|
29
29
|
# Define attribute writers to Builder instance according to
|
30
|
-
# existing accessors of
|
31
|
-
# @param object [
|
32
|
-
# @return [
|
30
|
+
# existing accessors of Abstract::Object instance
|
31
|
+
# @param object [Abstract::Object] - Abstract::Object instance
|
32
|
+
# @return [Abstract::Builder] - builder object
|
33
33
|
def initialize(object)
|
34
34
|
@object = Class.const_get(object).new
|
35
35
|
@attrs = @object.attrs
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abstracts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vsevolod Suzdaltsev
|
@@ -18,7 +18,9 @@ extra_rdoc_files: []
|
|
18
18
|
files:
|
19
19
|
- lib/abstracts.rb
|
20
20
|
homepage: http://rubygems.org/gems/abstracts
|
21
|
-
licenses:
|
21
|
+
licenses:
|
22
|
+
- MIT
|
23
|
+
- GPL-2.0
|
22
24
|
metadata: {}
|
23
25
|
post_install_message:
|
24
26
|
rdoc_options: []
|