vident 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,48 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- if Gem.loaded_specs.has_key? "dry-struct"
4
- require_relative "./attributes/typed"
5
-
6
- module Vident
7
- module TypedComponent
8
- extend ActiveSupport::Concern
9
-
10
- included do
11
- include Vident::Base
12
- include Vident::Attributes::Typed
13
-
14
- attribute :id, String, delegates: false
15
- attribute :html_options, Hash, delegates: false
16
- attribute :element_tag, Symbol, delegates: false
17
-
18
- # StimulusJS support
19
- attribute :controllers, Array, default: [], delegates: false
20
- attribute :actions, Array, default: [], delegates: false
21
- attribute :targets, Array, default: [], delegates: false
22
- attribute :data_maps, Array, default: [], delegates: false
23
-
24
- # TODO normalise the syntax of defining actions, controllers, etc
25
- attribute :named_classes, Hash, delegates: false
26
- end
27
-
28
- def initialize(attrs = {})
29
- before_initialise(attrs)
30
- prepare_attributes(attrs)
31
- # The attributes need to also be set as ivars
32
- attributes.each do |attr_name, attr_value|
33
- instance_variable_set(self.class.attribute_ivar_names[attr_name], attr_value)
34
- end
35
- after_initialise
36
- super()
37
- end
38
- end
39
- end
40
- else
41
- module Vident
42
- module TypedComponent
43
- def self.included(base)
44
- raise "Vident::TypedComponent requires dry-struct to be installed"
45
- end
46
- end
47
- end
48
- end
data/sig/vident.rbs DELETED
@@ -1,4 +0,0 @@
1
- module Vident
2
- VERSION: String
3
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
- end