elemental_components 1.0.0.rc2 → 1.0.0.rc3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 188ba4f31148a5b63a6bedc1d45471216563c5b50137c575e1846a8a319807fc
4
- data.tar.gz: 04a1af8dfe65532e07bdef3cbeb62c1e94faf6c7f9fabb4e940504215e80e3b1
3
+ metadata.gz: bb88125170fb3b81fdd8d0cb0b9be0f5b1c8307da40a5ba5d0484050e3de2718
4
+ data.tar.gz: c50f5078211e19c432c16685632009f0e16d53c59c7ed856a260e02fd47ca16f
5
5
  SHA512:
6
- metadata.gz: abd7a702a6030f480b384100a684c8e7cf841c5fcda44314c3d55e75236991c5a20d5c0042721bf446a6fdb3244253322f12aa1a4cd8b52bdc99a0b1dee8bbb4
7
- data.tar.gz: f30734ef9349f9baaa9f86b35dc6d865e0bbb64a4a380616db9ca5e9d47a7ace0ccf1aaee3c0943f4f9466be5524a7c48c98508c2680310a3a25937e58d73b6b
6
+ metadata.gz: 5234a41b3ddd11f1ab86d19d9e5f348904d04ed5f833535f29f6a6e3f20bc82ad722562bdf7b40fe1e0ef0cd026058cb7b3af1e46e81531bae91c7ba3b461ff2
7
+ data.tar.gz: aa07e5e7744360235f1ee400108860ee95f495042e5ddc12104e1873c42cc7792a91aafe723d41c07c17148f913d8f90f9cdb5989253a0a6d34945d6a787ca22
@@ -87,10 +87,16 @@ module ElementalComponents
87
87
 
88
88
  def initialize_attributes(attributes)
89
89
  self.class.attributes.each do |name, options|
90
- set_instance_variable(name, attributes[name] || (options[:default] && options[:default].dup))
90
+ set_instance_variable(name, attribute_value(attributes, name, options[:default]))
91
91
  end
92
92
  end
93
93
 
94
+ def attribute_value(attributes, name, default)
95
+ return attributes[name] if attributes.key?(name)
96
+
97
+ default.dup
98
+ end
99
+
94
100
  def initialize_elements
95
101
  self.class.elements.each do |name, options|
96
102
  if (plural_name = options[:multiple])
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ElementalComponents
4
- VERSION = "1.0.0.rc2"
4
+ VERSION = "1.0.0.rc3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elemental_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc2
4
+ version: 1.0.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Ljungblad
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-27 00:00:00.000000000 Z
11
+ date: 2021-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -109,8 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  - !ruby/object:Gem::Version
110
110
  version: 1.3.1
111
111
  requirements: []
112
- rubyforge_project:
113
- rubygems_version: 2.7.6
112
+ rubygems_version: 3.0.3
114
113
  signing_key:
115
114
  specification_version: 4
116
115
  summary: Simple view components for Rails 5.1+