add form text

master
Kanezoh 2021-06-17 15:49:46 +09:00
parent 23b2748e0f
commit c7f361a698
3 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,7 @@
require "./form/field"
require "./form/check_box"
require "./form/radio_button"
require "./form/check_box"
require "./form/text"
class MechanizeCr::Form
getter fields : Array(FormContent::Field)
@ -78,6 +79,8 @@ class MechanizeCr::Form
checkboxes << FormContent::CheckBox.new(html_node, self)
when "radio"
radiobuttons << FormContent::RadioButton.new(html_node, self)
when "text"
fields << FormContent::Text.new(html_node)
else
fields << FormContent::Field.new(html_node)
end

View File

@ -1,4 +1,3 @@
require "./radio_button"
class MechanizeCr::FormContent::CheckBox < MechanizeCr::FormContent::RadioButton
def check
@checked = true

View File

@ -0,0 +1,2 @@
class MechanizeCr::FormContent::Text < MechanizeCr::FormContent::Field
end