Class: Metallize::Form::Field
- Inherits:
-
Object
- Object
- Metallize::Form::Field
- Defined in:
- lib/metallize/form/field.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#node ⇒ Object
Returns the value of attribute node.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(node, value = node.attribute('value')) ⇒ Field
constructor
A new instance of Field.
-
#inspect ⇒ Object
:nodoc:.
Constructor Details
#initialize(node, value = node.attribute('value')) ⇒ Field
Returns a new instance of Field.
5 6 7 8 9 10 |
# File 'lib/metallize/form/field.rb', line 5 def initialize(node, value = node.attribute('value')) @node = node @name = node.attribute('name') @type = node.attribute('type') @value = value end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/metallize/form/field.rb', line 3 def name @name end |
#node ⇒ Object
Returns the value of attribute node.
3 4 5 |
# File 'lib/metallize/form/field.rb', line 3 def node @node end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/metallize/form/field.rb', line 3 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/metallize/form/field.rb', line 3 def value @value end |
Instance Method Details
#inspect ⇒ Object
:nodoc:
12 13 14 15 16 17 |
# File 'lib/metallize/form/field.rb', line 12 def inspect # :nodoc: "[%s:0x%x type: %s name: %s value: %s]" % [ self.class.name.sub(/Metallize::Form::/, '').downcase, object_id, type, name, value ] end |