data_crate 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: 3273aece6d16800e93bc31918f62ff61ac5acf1631832be61288f8dc98b85499
4
- data.tar.gz: b7f2c8bda1a4058fb5f02123f9e1eb94eefe227e9b738b97d89521fd94c1b3ac
3
+ metadata.gz: b2f68e24db8a02b02e05cc10d54b34c04e2636d11d3a6e96466dc64584ac732e
4
+ data.tar.gz: 8f4d80b7177ed6fb02a96b06eb3d91fe432bcf6e0676d2ef50b57fcb28217a5f
5
5
  SHA512:
6
- metadata.gz: 829404929d4f985e3ac801539d05b1422f55fa7cf3a5dab04212a9d9de429145bf9d45187625e68dc90f541d0ba5e7a02e631d4f966dc2e36b78d8250926c55d
7
- data.tar.gz: ee10cbe8fa477dcfb3b68a896ed0ce5a505d6503e6fa8ce6278885b593d77a0b332fb8a2b536093a981adbc7e0da79602a90ea62892a6994e07e37366daef258
6
+ metadata.gz: '0169f00f004407f0bd56a2feb094ce98cba818c9f850ffbddfd00e7b594255c53d5752e027df0d0a6adcc66235f8bad4be215c6c0dcede0c63398852b668bb3b'
7
+ data.tar.gz: ac28099a262a461332ce89e88bc0d92b79745dd4809bb31dccfdb3ce116cf5692afc7bec9e5fddfa8adc5ce749534fdbdec40dbb47705e8707432cdbdd5a6b09
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- data_crate (0.1.2)
4
+ data_crate (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/crate/crate.rb CHANGED
@@ -129,9 +129,7 @@ module Crate
129
129
  @_raw = Raw.new(raw, **_options).to_hash
130
130
  _new_crates
131
131
  _run_hooks
132
-
133
- return if self.class._crate_klasses.empty?
134
- _select_klass(_find_valid_klass(raw, **options))
132
+ _select_klass_if_exist(**options)
135
133
  end
136
134
 
137
135
  def _new_crates
@@ -146,6 +144,11 @@ module Crate
146
144
  self.class._hooks.each { |hook| instance_eval(&hook) }
147
145
  end
148
146
 
147
+ def _select_klass_if_exist(**options)
148
+ return if self.class._crate_klasses.empty?
149
+ _select_klass(_find_valid_klass(_raw, **options))
150
+ end
151
+
149
152
  def _find_valid_klass(*args)
150
153
  self.class._crate_klasses.find do |klass|
151
154
  klass._valid_crate?(*args)
@@ -165,7 +168,7 @@ module Crate
165
168
 
166
169
  def _select_klass(klass)
167
170
  _exit_if_no_klass(klass)
168
- @_crate = klass.new(@_raw, **_options)
171
+ @_crate = klass.new(_raw, **_options)
169
172
  (methods - REJECT_METHODS).each do |method_name|
170
173
  instance_eval("undef #{method_name.inspect}")
171
174
  end
data/lib/crate/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Crate
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_crate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Minwoo Lee