arrange indent

master
Kanezoh 2021-07-15 09:00:23 +09:00
parent f2434a4c5a
commit 6ff9590f48
4 changed files with 20 additions and 19 deletions

View File

@ -1,15 +1,15 @@
class MechanizeCr::FormContent::Field
getter :node
property value : String?
getter name : String
getter type : String
getter raw_value : String?
getter node : Node | Myhtml::Node
def initialize(node : Node | Myhtml::Node, value=nil)
@node = node
@name = node.fetch("name", "")
@value = value || node.fetch("value", nil)
@type = node.fetch("type", "")
@node = node
@name = node.fetch("name", "")
@value = value || node.fetch("value", nil)
@type = node.fetch("type", "")
@raw_value = @value
end

View File

@ -2,16 +2,16 @@ require "./option"
class MechanizeCr::FormContent::MultiSelectList
getter node : Myhtml::Node
property values : Array(String)
getter name : String
getter type : String
property values : Array(String)
property options : Array(FormContent::Option)
def initialize(node : Myhtml::Node)
@node = node
@name = node.fetch("name", "")
@type = node.fetch("type", "")
@values = Array(String).new
@node = node
@name = node.fetch("name", "")
@type = node.fetch("type", "")
@values = Array(String).new
@options = Array(FormContent::Option).new
node.css("option").each { |n|
@options << FormContent::Option.new(n, self)

View File

@ -1,14 +1,15 @@
class MechanizeCr::FormContent::Option
getter select_list : FormContent::MultiSelectList
getter node : Myhtml::Node
getter text : String
getter value : String
getter selected : Bool
getter node : Myhtml::Node
getter text : String
getter value : String
getter selected : Bool
def initialize(node, select_list)
@node = node
@text = node.inner_text
@value = (node["value"] || node.inner_text)
@selected = node.has_key?("selected")
@node = node
@text = node.inner_text
@value = (node["value"] || node.inner_text)
@selected = node.has_key?("selected")
@select_list = select_list # The select list this option belongs to
end

View File

@ -3,7 +3,7 @@ class MechanizeCr::FormContent::RadioButton < MechanizeCr::FormContent::Field
def initialize(node : Node | Myhtml::Node, form : Form)
@checked = !!node.fetch("checked", nil)
@form = form
@form = form
super(node)
end