view_component_storybook 0.5.0 → 0.6.0

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: 75f49d5b86688ebe7d9edbb9233ca05e7bf8f4f96531a305c894be2716a9602f
4
- data.tar.gz: 943f38d06448e65ea33663617de373d3b3e1e433834225f2d1998a7bb75fa654
3
+ metadata.gz: cc377c2ee4e53057d77622560164f181fcaca50a95e4fcfc53ad78a3cb10a2ba
4
+ data.tar.gz: b1137074ecbb7b5d44c38475774d06400b936f427dfec1bd1602fe4edb1696d7
5
5
  SHA512:
6
- metadata.gz: 38cec8aad9a6e3771f50a7e5b2101d56a6fd58944e277300cea97fe74aa8827d2f6ffb6ae1ade78209bb1fb8b39362bc785a062df38dcdee6f25186af4d24f5e
7
- data.tar.gz: 95cfd875ef6c6fdbfb276ec768629bcf4b83aaeb43a2f5a64316f2e311456f81c55293d888b56c04dd7bfb15ad317f03db66f3e21c6c8a561637b074cf47f7c4
6
+ metadata.gz: c8bbafc19737e00f631c0099affc6c616e327c4bfc60e9426fb74e55550701d915131f15d5d00d780dd3b6374c940edd17feebe24774c91e48db84accd46930d
7
+ data.tar.gz: 2d992393f87285d057bedaffd9be722cd8d147a38f543b2a1afdb9c92d73e6ce26546744941826cd91517c2d1f30e27f782d8090e07d420343241c1a5bb20c8d
@@ -21,7 +21,7 @@ module ViewComponent
21
21
 
22
22
  TYPES = %i[select multi-select radio inline-radio check inline-check].freeze
23
23
 
24
- attr_reader :type, :options
24
+ attr_reader :type, :options, :symbol_value
25
25
 
26
26
  validates :value, :type, :options, presence: true
27
27
  validates :type, inclusion: { in: TYPES }, unless: -> { type.nil? }
@@ -31,6 +31,15 @@ module ViewComponent
31
31
  super(component, param, default_value, name: name)
32
32
  @type = type
33
33
  @options = options
34
+ @symbol_value = default_value.is_a?(Symbol)
35
+ end
36
+
37
+ def value_from_param(param)
38
+ if param.is_a?(String) && symbol_value
39
+ param.to_sym
40
+ else
41
+ super(param)
42
+ end
34
43
  end
35
44
 
36
45
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ViewComponent
4
4
  module Storybook
5
- VERSION = "0.5.0"
5
+ VERSION = "0.6.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: view_component_storybook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Palmer