Skip to content

Commit 00462f5

Browse files
author
Nils Henning
committed
replace REQUIRED_KEYS in components with new requires command
1 parent 6eb97a9 commit 00462f5

File tree

17 files changed

+86
-25
lines changed

17 files changed

+86
-25
lines changed

.byebug_history

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,41 @@
11
continue
2+
save_screenshot
3+
continue
4+
save_screenshot
5+
continue
6+
save_screenshot
7+
continue
8+
prop.flatten
9+
prop
10+
continue
11+
prop
12+
continue
13+
prop.flatten
14+
prop.flatten!
15+
prop.flatten
16+
prop.keys.first
17+
prop.keys
18+
prop
19+
prop.flatten
20+
prop
21+
prop.key
22+
prop.values.first[:alias]
23+
prop.values.first[:alias
24+
prop.values.first
25+
prop.values
26+
prop.first
27+
prop[:alias]
28+
prop.is_a? Hash
29+
self.class.requires_properties
30+
continue
31+
self.class.requires_properties
32+
continue
33+
Matestack::Ui::Core::Form::Form.instance_methods.include? :method
34+
Matestack::Ui::Core::Form::Form.instance_methods.contains? :method
35+
Matestack::Ui::Core::Form::Form.instance_methods
36+
Matestack::Ui::Core::Form::Form
37+
save_screenshot
38+
continue
239
PropertyComponent.new(title: 'Test', foo: 'Foo').respond_to?(:title)
340
PropertyComponent.new.respond_to?(:title)
441
PropertyComponent.new.respond_to?(:title))

app/concepts/matestack/ui/core/bdo/bdo.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Matestack::Ui::Core::Bdo
22
class Bdo < Matestack::Ui::Core::Component::Static
3-
REQUIRED_KEYS = [:dir]
3+
requires :dir
44

55
def setup
66
@tag_attributes.merge!({

app/concepts/matestack/ui/core/form/form.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Matestack::Ui::Core::Form
22
class Form < Matestack::Ui::Core::Component::Dynamic
33

4-
REQUIRED_KEYS = [:for, :path, :method]
4+
requires :for, :path, method: { as: :form_method }
55

66
def vuejs_component_name
77
"matestack-ui-core-form"

app/concepts/matestack/ui/core/form/input/input.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
module Matestack::Ui::Core::Form::Input
22
class Input < Matestack::Ui::Core::Component::Static
33

4-
REQUIRED_KEYS = [:key, :type]
4+
requires :key, :type
55

66
def custom_options_validation
77
raise "included form config is missing, please add ':include' to parent form component" if @included_config.nil?
88
end
99

10-
def key
11-
options[:key]
12-
end
13-
1410
def label
1511
options[:label]
1612
end
1713

18-
def type
19-
options[:type]
20-
end
21-
2214
def placeholder
2315
options[:placeholder]
2416
end

app/concepts/matestack/ui/core/form/select/select.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Matestack::Ui::Core::Form::Select
22
class Select < Matestack::Ui::Core::Component::Static
33

4-
REQUIRED_KEYS = [:options]
4+
requires options: { as: :select_options }
55

66
def setup
77
if @tag_attributes[:id].nil?

app/concepts/matestack/ui/core/link/link.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Matestack::Ui::Core::Link
22
class Link < Matestack::Ui::Core::Component::Static
33

4-
REQUIRED_KEYS = [:path]
4+
requires :path
55

66
def setup
77
@tag_attributes.merge!({

app/concepts/matestack/ui/core/map/map.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Matestack::Ui::Core::Map
22
class Map < Matestack::Ui::Core::Component::Static
3-
REQUIRED_KEYS = [:name]
3+
requires :name
44

55
def setup
66
@tag_attributes.merge!({

app/concepts/matestack/ui/core/progress/progress.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Matestack::Ui::Core::Progress
22
class Progress < Matestack::Ui::Core::Component::Static
33

4-
REQUIRED_KEYS = [:max]
4+
requires :max
55

66
def setup
77
@tag_attributes.merge!({

app/concepts/matestack/ui/core/video/video.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Matestack::Ui::Core::Video
22
class Video < Matestack::Ui::Core::Component::Static
33

4-
REQUIRED_KEYS = [:path, :type]
4+
requires :path, :type
55

66
def setup
77
@tag_attributes.merge!({

app/concepts/matestack/ui/core/youtube/youtube.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Matestack::Ui::Core::Youtube
22
class Youtube < Matestack::Ui::Core::Component::Static
33

4-
REQUIRED_KEYS = [:yt_id, :height, :width]
4+
requires :yt_id, :height, :width
55

66
def setup
77
url = 'https://www.youtube.com/embed/'

0 commit comments

Comments
 (0)