model_pack 0.9.11 → 1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -6
- data/lib/model_pack/version.rb +1 -1
- data/model_pack.gemspec +12 -12
- metadata +12 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75d398395912e6dad333ca4a16836ff19c085111
|
4
|
+
data.tar.gz: 966d8985a9e7641e2975d12a7074c4dc2098841d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6c64ed1107745538094540241c7b0edb63bad94707bc6ec2b8b59031b64be929489f5de730a507a3a4c38426c73a4f5e1bec57734314e1bffba63590d43c0e8
|
7
|
+
data.tar.gz: 3811e52221c404e1fea6df0a05e6351f3ace0e1d92fe45b35365588784d5eba662a1a9fa5cfe42f7e718d538049fa0413a87e6c32f14b309a99d895648b4a71c
|
data/README.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# Model Pack - model interfaces
|
2
2
|
|
3
|
-
Model Pack - набор интерфейсов, который позволяет создавать
|
4
|
-
Также добавляет методы работы model attributes.
|
5
|
-
|
3
|
+
Model Pack - набор интерфейсов, который позволяет создавать специальные атрибуты в объекте.
|
4
|
+
Также добавляет методы работы model attributes. Позволяет сериализовывать атрибуты модели, сохраняя их правильную иерархию.
|
5
|
+
|
6
|
+
Model Pack is an interfaces collection for creating object's attributes. It also adds methods for working with this attributes and allows to safely serialize your model without loosing their hierarchical structure.
|
6
7
|
|
7
8
|
## Installation
|
8
9
|
|
@@ -22,7 +23,7 @@ Or install it yourself as:
|
|
22
23
|
|
23
24
|
## Использование
|
24
25
|
|
25
|
-
### Атрибуты и
|
26
|
+
### Атрибуты и вложенные объекты
|
26
27
|
|
27
28
|
```ruby
|
28
29
|
class Point
|
@@ -44,7 +45,7 @@ class Line
|
|
44
45
|
end
|
45
46
|
```
|
46
47
|
|
47
|
-
Создаем
|
48
|
+
Создаем экземпляры модели:
|
48
49
|
|
49
50
|
```ruby
|
50
51
|
point = Point.new(x: 3, y: 5)
|
@@ -55,7 +56,7 @@ line = Line.new(
|
|
55
56
|
puts line.length
|
56
57
|
```
|
57
58
|
|
58
|
-
### Перекрываем запись
|
59
|
+
### Перекрываем запись атрибутов
|
59
60
|
|
60
61
|
```ruby
|
61
62
|
class Text
|
data/lib/model_pack/version.rb
CHANGED
data/model_pack.gemspec
CHANGED
@@ -4,24 +4,24 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'model_pack/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'model_pack'
|
8
8
|
spec.version = ModelPack::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.summary =
|
12
|
-
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
9
|
+
spec.authors = ['Maksim V.']
|
10
|
+
spec.email = ['inre.strom@gmail.com']
|
11
|
+
spec.summary = 'Using Ruby classes aka ("models") with smart serialization mechanizm'
|
12
|
+
spec.description = spec.summary
|
13
|
+
spec.homepage = 'https://github.com/emmygems'
|
14
|
+
spec.license = 'MIT'
|
15
15
|
|
16
|
-
spec.required_ruby_version = '>= 2.
|
16
|
+
spec.required_ruby_version = '>= 2.1.0'
|
17
17
|
spec.required_rubygems_version = '>= 2.3.0'
|
18
18
|
|
19
19
|
spec.files = `git ls-files -z`.split("\x0")
|
20
20
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
21
21
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
22
|
-
spec.require_paths = [
|
22
|
+
spec.require_paths = ['lib']
|
23
23
|
|
24
|
-
spec.add_development_dependency
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.12'
|
25
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
26
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
27
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: model_pack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0
|
4
|
+
version: '1.0'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Maksim V.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.12'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.12'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,15 +44,15 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 3.0
|
47
|
+
version: '3.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 3.0
|
55
|
-
description:
|
54
|
+
version: '3.0'
|
55
|
+
description: Using Ruby classes aka ("models") with smart serialization mechanizm
|
56
56
|
email:
|
57
57
|
- inre.strom@gmail.com
|
58
58
|
executables: []
|
@@ -76,7 +76,7 @@ files:
|
|
76
76
|
- model_pack.gemspec
|
77
77
|
- spec/model_pack_spec.rb
|
78
78
|
- spec/spec_helper.rb
|
79
|
-
homepage:
|
79
|
+
homepage: https://github.com/emmygems
|
80
80
|
licenses:
|
81
81
|
- MIT
|
82
82
|
metadata: {}
|
@@ -88,7 +88,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
88
88
|
requirements:
|
89
89
|
- - ">="
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version: 2.
|
91
|
+
version: 2.1.0
|
92
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
@@ -96,11 +96,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: 2.3.0
|
97
97
|
requirements: []
|
98
98
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.
|
99
|
+
rubygems_version: 2.6.6
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
|
-
summary:
|
102
|
+
summary: Using Ruby classes aka ("models") with smart serialization mechanizm
|
103
103
|
test_files:
|
104
104
|
- spec/model_pack_spec.rb
|
105
105
|
- spec/spec_helper.rb
|
106
|
-
has_rdoc:
|