diva 0.1.0 → 0.1.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: f3d371525ed19621b1a152a2623587783e4802e9
4
- data.tar.gz: dfbe31dde289f9399e54ddbb07174652dc41efc8
3
+ metadata.gz: 2929c06c06248e820556866e691d09ca8b17701c
4
+ data.tar.gz: df318101c0fc97e58705d17f8f996e9dac248216
5
5
  SHA512:
6
- metadata.gz: 1b8cded54cb6406710cca50f95947c39f72fa3398ce43a7a0b38e69b7932a9860714a5aa005cf1e561cfdd2bd8cab557b647b036f241898b2f568c8e6f972105
7
- data.tar.gz: 81150d4fa04f1b9d4a8c83e754b788362f21ddf441ff5fc0fcc2e84b4bb53f08818fc613c096f874db9412cb1356c504324f26b387c009a228ed114308f14025
6
+ metadata.gz: ce219d41da367da84d92c36fdd312ede04a7f302bdaa9a48f1446546e006c9146ed753f3ff91fc2aed845381c36c626a8dc50bf49850315914fb7e15d7e2bb37
7
+ data.tar.gz: 7274106f32830aaaacb8365b63ebd8f9de4e60b7afce1f0107173cd9fb347324fbfd2338f3ae43072d6b3fdbc616829257ec223c6cc1219936da02e11c956ce1
data/lib/diva/type.rb CHANGED
@@ -155,6 +155,7 @@ module Diva::Type
155
155
 
156
156
  class ArrayType < MetaType
157
157
  def initialize(type)
158
+ type = Diva::Type(type)
158
159
  super("#{type.name}_array")
159
160
  @type = type
160
161
  end
@@ -207,10 +208,12 @@ module Diva
207
208
  Diva::Type::TIME
208
209
  when :uri
209
210
  Diva::Type::URI
210
- when ->x{x.superclass == Diva::Model}
211
+ when ->x{x.class == Class && x.ancestors.include?(Diva::Model) }
211
212
  Diva::Type.model_of(type)
212
213
  when Array
213
214
  Diva::Type.array_of(type.first)
215
+ else
216
+ fail "Invalid type #{type.inspect} (#{type.class})."
214
217
  end
215
218
  end
216
219
  end
data/lib/diva/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Diva
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diva
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
  - Toshiaki Asai