mitake 0.1.1 → 0.1.2

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: 0bc77dea3bd7f54bf6d2caa74e29b07e6ec41f638e6ff690a1ec192926d68f3b
4
- data.tar.gz: 927a1db28c4873a67cd9bada409668566cb5f6538fc809a63e9a84d5120af3cf
3
+ metadata.gz: 588de0a453cae48483cf27f37c74b2db75e5c5682ed08ac10a3057cd4e478a75
4
+ data.tar.gz: c338e59a0bcd8df934aae0f52be63c96a7a27bab641efddab5b4758250e1fac8
5
5
  SHA512:
6
- metadata.gz: '03486c3db05629c230e9cbd2512cd7542afa21bfa5f6bef4f5581187b1ad92f84186834b69ffe102de3d5ab474c89d75814c40424f4c458f58f154f943b45209'
7
- data.tar.gz: 321ce56965a7760cce6634d1c774f519181bbe39d85b346d81ad372e9817b041b1a97e40105d274e82a802edd91d5a73a51c899e40602019bedb318769553495
6
+ metadata.gz: 8b6fa1a4e0e4eee00e87a0f8635ccc57d43a3e8cf09fa43775e1c0313ff0f9043efaa269dcb82cc7c2bb9d64959efc45cde7fd66fac5be63893da9bb16c24947
7
+ data.tar.gz: c64cc7fe68bd9f0b4734bb865927b9d1ecfae1d9ad34018a6d6d66f372b274eb12f5914014029b1f2ae5d82211869d66dc2be95553cb4ba871cee5ba9332faa1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mitake (0.1.1)
4
+ mitake (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -18,23 +18,6 @@ module Mitake
18
18
  end
19
19
  end
20
20
 
21
- # Assign attribute by hash
22
- #
23
- # @see Mitake::Model::Attributes#assign_attributes
24
- #
25
- # @param attributes [Hash] the attributes to assignment
26
- #
27
- # @since 0.1.0
28
- def assign_attributes(attributes = {})
29
- attributes.each do |key, value|
30
- next unless self.class.attribute_names.include?(key.to_s)
31
- next send("#{key}=", value) if respond_to?("#{key}=")
32
-
33
- type = self.class.attributes[key.to_s]
34
- instance_variable_set("@#{key}", self.class.cast(value, type))
35
- end
36
- end
37
-
38
21
  # Get attributes as hash
39
22
  #
40
23
  # @return [Hash] the object attributes
@@ -18,7 +18,11 @@ module Mitake
18
18
  # @since 0.1.0
19
19
  def assign_attributes(attributes = {})
20
20
  attributes.each do |key, value|
21
- send("#{key}=", value)
21
+ next unless self.class.attribute_names.include?(key.to_s)
22
+ next send("#{key}=", value) if respond_to?("#{key}=")
23
+
24
+ type = self.class.attributes[key.to_s]
25
+ instance_variable_set("@#{key}", self.class.cast(value, type))
22
26
  end
23
27
  end
24
28
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mitake
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mitake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - 蒼時弦也