model_pack 0.9.8 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e3431618487aca9441dc63def598c19facee8c2
4
- data.tar.gz: 6af701855851fb9d9723c3afa9d4a53de3d93682
3
+ metadata.gz: 1c1af401362eadd275703307aa2eb0da1bb5a5cf
4
+ data.tar.gz: 61bfb74ee44ea86622cff233813c3842569a0ca0
5
5
  SHA512:
6
- metadata.gz: c3b66df9a504671fa2855fa778ae4569ae16c87cf0f5e4b907737c7da3571176986421fc6a7a7268d2f7753eee48c713f5496861604c067361e7e8c327ad249f
7
- data.tar.gz: e64b579657bf9b061a7db270fb242e3b478ae7156f90b243f5f2a08ece9699bd2b2ad4153de9e107cb20977ac40056816c94c6896fab0891c609e88184641976
6
+ metadata.gz: 68f387d15f4b67a4da2ef6cd164a10928afd9b55aed1fe504d9c9297c3af790eb75df614a6f77f9cc3e8d7eef913872ecf288f0eeffce7f4444be0abb8a52dc1
7
+ data.tar.gz: 0c8ac45bfc9de6c78010129b30858c4b937297c3c4ec390c92b096bb55925d90bb011d1e9df8235e02b4aafa29d0226112d8bcfd99d3121a54cecb80bec7d9b3
@@ -33,11 +33,12 @@ module ModelPack
33
33
  end if serialize
34
34
  end
35
35
 
36
- def object(name, class_name: nil, default: nil, serialize: nil, predicate: nil)
36
+ def object(name, class_name: nil, default: nil, as: nil, serialize: nil, predicate: nil)
37
37
  attribute(name,
38
38
  default: default,
39
39
  serialize: serialize,
40
40
  predicate: predicate,
41
+ as: as,
41
42
  writer: lambda { |v| v.is_a?(Hash) && class_name ? class_name.new(v) : v })
42
43
  end
43
44
 
@@ -1,3 +1,3 @@
1
1
  module ModelPack
2
- VERSION = "0.9.8"
2
+ VERSION = "0.9.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_pack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - inre
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  version: 2.3.0
97
97
  requirements: []
98
98
  rubyforge_project:
99
- rubygems_version: 2.4.3
99
+ rubygems_version: 2.4.6
100
100
  signing_key:
101
101
  specification_version: 4
102
102
  summary: Model Pack – simple models