add file comment
This commit is contained in:
parent
45f14baad0
commit
8b346642ae
@ -1,9 +1,15 @@
|
||||
require "http/client"
|
||||
|
||||
class Mechanize
|
||||
class File
|
||||
# property :body, :filename
|
||||
property :body, :code, uri, :response
|
||||
abstract class File
|
||||
# property :filename
|
||||
|
||||
# returns http response body
|
||||
getter body : String
|
||||
# returns http status code
|
||||
getter code : Int32
|
||||
# returns page uri
|
||||
getter uri : URI
|
||||
|
||||
def initialize(uri : URI, response : ::HTTP::Client::Response, body : String, code : Int32)
|
||||
@uri = uri
|
||||
|
@ -13,7 +13,7 @@ class Mechanize::Form
|
||||
include Mechanize::ElementMatcher
|
||||
|
||||
getter node : Node | Lexbor::Node
|
||||
# returns an array of `Mechanize::FormContent::Field` in the form.
|
||||
# returns hoge array of `Mechanize::FormContent::Field` in the form.
|
||||
getter fields : Array(FormContent::Field)
|
||||
# returns an array of input tags whose type is checkbox in the form.
|
||||
getter checkboxes : Array(FormContent::CheckBox)
|
||||
@ -23,11 +23,16 @@ class Mechanize::Form
|
||||
getter selectboxes : Array(FormContent::MultiSelectList)
|
||||
# returns an array of button tags and input tag whose type is button,submit,reset,image.
|
||||
getter buttons : Array(FormContent::Button)
|
||||
# returns form's 'enctype' attribute.
|
||||
getter enctype : String
|
||||
# returns form's 'method' attribute.
|
||||
getter method : String
|
||||
# returns form's 'name' attribute.
|
||||
getter name : String
|
||||
getter page : Mechanize::Page?
|
||||
# return form's 'action' attribute.
|
||||
property action : String
|
||||
# returns the page which includes the form.
|
||||
getter page : Mechanize::Page?
|
||||
|
||||
def initialize(node : Node | Lexbor::Node, page : Mechanize::Page? = nil)
|
||||
@enctype = node.fetch("enctype", "application/x-www-form-urlencoded")
|
||||
|
@ -6,7 +6,7 @@ class Mechanize
|
||||
#
|
||||
# Examples
|
||||
# ```
|
||||
# # if you specify String like "foo", it searches form which name is "foo".
|
||||
# # if you specify String like "foo", it searches {{ singular.id }} which name is "foo".
|
||||
{% if ["form", "button"].includes?("#{singular.id}") %}
|
||||
# # like <{{ singular.id }} name="foo"></{{ singular.id }}>
|
||||
{% elsif "#{singular.id}" == "field" %}
|
||||
|
Loading…
Reference in New Issue
Block a user