Class: Watobo::Parser::HTML::InputField
- Inherits:
-
Object
- Object
- Watobo::Parser::HTML::InputField
- Defined in:
- lib/watobo/parser/html.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(input_css) ⇒ InputField
constructor
A new instance of InputField.
- #method_missing(name, *args, &block) ⇒ Object
- #to_url_parm ⇒ Object
-
#to_www_form_parm ⇒ Object
attr :autocomplete.
Constructor Details
#initialize(input_css) ⇒ InputField
Returns a new instance of InputField.
39 40 41 42 43 44 45 |
# File 'lib/watobo/parser/html.rb', line 39 def initialize(input_css) @css = input_css @id = input_css["id"].nil? ? "" : input_css["id"] @value = input_css["value"].nil? ? "" : input_css["value"] @name = input_css["name"].nil? ? "" : input_css["name"] #@autocomplete = input_css["autocomplete"] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
47 48 49 |
# File 'lib/watobo/parser/html.rb', line 47 def method_missing(name, *args, &block) @css[name.to_s].nil? ? "" : input_css[name.to_s] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
26 27 28 |
# File 'lib/watobo/parser/html.rb', line 26 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
28 29 30 |
# File 'lib/watobo/parser/html.rb', line 28 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
27 28 29 |
# File 'lib/watobo/parser/html.rb', line 27 def value @value end |
Instance Method Details
#to_url_parm ⇒ Object
35 36 37 |
# File 'lib/watobo/parser/html.rb', line 35 def to_url_parm() Watobo::UrlParameter.new(:name => @name, :value => @value) end |
#to_www_form_parm ⇒ Object
attr :autocomplete
31 32 33 |
# File 'lib/watobo/parser/html.rb', line 31 def to_www_form_parm() Watobo::WWWFormParameter.new(:name => @name, :value => @value) end |