json_world 0.2.0 → 0.2.1

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: a5aef48228e4c1d49717c2f834412ea45ddc98ae
4
- data.tar.gz: c1ce06838c98f6a6b18c4dbf834619879b44eb7f
3
+ metadata.gz: 36ef7bdefa96257f11c02b4b20f5f9fa3d04e12c
4
+ data.tar.gz: 15ba507ff51c82985fb0b820c7bc360d86f64742
5
5
  SHA512:
6
- metadata.gz: 3db2e0a659ba8b9c559e8862eab6a88f76de7a87f49961743b9b19d54b7eef854d15a52acaae6c5da9220345f1a2d0cc7855fcf8c34744d948ab7c76d3a3bdea
7
- data.tar.gz: 70522ff96af036d7ab5b20c6e830173e3e4ca68613ce70bce2d5ef7532148738401a184a72f2fce98daecb18d6595c2f425fb344115dd85c5f589b7515505ed2
6
+ metadata.gz: f8149f3e22fee2bb7d0a0c9d78d1330c7bd705044465a2179dfdf856d34898324736bd0a0d85e197a9953610cde9dff2bdf3a265c0ce8f01eb2b319751b69e5c
7
+ data.tar.gz: 78ba6009028cfdd980c203c2e9b419e4c520e59d2ca2f95b04aa760f8981684f689b0a3d24f9645093bb2efe38e00dc036a051e8e60bd73a4ffd74a659cc224f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.2.1
2
+ - Provides raw_options method to reuse args for property definition
3
+
1
4
  ## 0.2.0
2
5
  - Support :links option on embedding other resource as property
3
6
 
@@ -89,7 +89,7 @@ module JsonWorld
89
89
  property_definitions.reject(&:optional?).map(&:property_name)
90
90
  end
91
91
 
92
- # @note .as_json_schema wrappter
92
+ # @note .as_json_schema wrapper
93
93
  # @return [String]
94
94
  def to_json_schema
95
95
  JSON.pretty_generate(as_json_schema)
@@ -47,6 +47,13 @@ module JsonWorld
47
47
  !!@options[:optional]
48
48
  end
49
49
 
50
+ # @return [Hash{Symbol => Object}]
51
+ def raw_options
52
+ @options.merge(
53
+ property_name: @property_name,
54
+ )
55
+ end
56
+
50
57
  private
51
58
 
52
59
  # @return [String, nil]
@@ -138,6 +145,8 @@ module JsonWorld
138
145
  "null"
139
146
  when this_type == String || this_type == Time
140
147
  "string"
148
+ when this_type.is_a?(String)
149
+ this_type
141
150
  end
142
151
  end.compact.uniq
143
152
  strings.length >= 2 ? strings : strings.first
@@ -1,3 +1,3 @@
1
1
  module JsonWorld
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_world
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-03 00:00:00.000000000 Z
11
+ date: 2015-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport