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.
60 61 62 63 64 65 66 |
# File 'lib/watobo/parser/html.rb', line 60 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
68 69 70 |
# File 'lib/watobo/parser/html.rb', line 68 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.
47 48 49 |
# File 'lib/watobo/parser/html.rb', line 47 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
49 50 51 |
# File 'lib/watobo/parser/html.rb', line 49 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
48 49 50 |
# File 'lib/watobo/parser/html.rb', line 48 def value @value end |
Instance Method Details
#to_url_parm ⇒ Object
56 57 58 |
# File 'lib/watobo/parser/html.rb', line 56 def to_url_parm() Watobo::UrlParameter.new(:name => @name, :value => @value) end |
#to_www_form_parm ⇒ Object
attr :autocomplete
52 53 54 |
# File 'lib/watobo/parser/html.rb', line 52 def to_www_form_parm() Watobo::WWWFormParameter.new(:name => @name, :value => @value) end |