From c7f361a69844bd4813bfd28c3211c6b4d7a8646f Mon Sep 17 00:00:00 2001 From: Kanezoh Date: Thu, 17 Jun 2021 15:49:46 +0900 Subject: [PATCH] add form text --- src/mechanize/form.cr | 5 ++++- src/mechanize/form/check_box.cr | 1 - src/mechanize/form/text.cr | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 src/mechanize/form/text.cr diff --git a/src/mechanize/form.cr b/src/mechanize/form.cr index cc0315a..baa1cec 100644 --- a/src/mechanize/form.cr +++ b/src/mechanize/form.cr @@ -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 diff --git a/src/mechanize/form/check_box.cr b/src/mechanize/form/check_box.cr index 98c0251..3e9c13c 100644 --- a/src/mechanize/form/check_box.cr +++ b/src/mechanize/form/check_box.cr @@ -1,4 +1,3 @@ -require "./radio_button" class MechanizeCr::FormContent::CheckBox < MechanizeCr::FormContent::RadioButton def check @checked = true diff --git a/src/mechanize/form/text.cr b/src/mechanize/form/text.cr new file mode 100644 index 0000000..6ed9f1f --- /dev/null +++ b/src/mechanize/form/text.cr @@ -0,0 +1,2 @@ +class MechanizeCr::FormContent::Text < MechanizeCr::FormContent::Field +end