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 +4 -4
- data/lib/elemental_components/element.rb +7 -1
- data/lib/elemental_components/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb88125170fb3b81fdd8d0cb0b9be0f5b1c8307da40a5ba5d0484050e3de2718
|
4
|
+
data.tar.gz: c50f5078211e19c432c16685632009f0e16d53c59c7ed856a260e02fd47ca16f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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])
|
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.
|
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:
|
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
|
-
|
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+
|