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