Class: Sandals::TextField
- Inherits:
-
Object
- Object
- Sandals::TextField
- Includes:
- Actionable, FieldValidation
- Defined in:
- lib/sandals/view.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes included from FieldValidation
Instance Method Summary collapse
- #change(value) ⇒ Object
-
#initialize(id, label, value:, action:, error: nil) ⇒ TextField
constructor
A new instance of TextField.
Methods included from FieldValidation
Constructor Details
#initialize(id, label, value:, action:, error: nil) ⇒ TextField
Returns a new instance of TextField.
321 322 323 324 325 326 327 |
# File 'lib/sandals/view.rb', line 321 def initialize(id, label, value:, action:, error: nil) @id = id @label = label.to_s @value = value.to_s initialize_error(error) @action = action end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
319 320 321 |
# File 'lib/sandals/view.rb', line 319 def id @id end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
319 320 321 |
# File 'lib/sandals/view.rb', line 319 def label @label end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
319 320 321 |
# File 'lib/sandals/view.rb', line 319 def value @value end |
Instance Method Details
#change(value) ⇒ Object
329 330 331 |
# File 'lib/sandals/view.rb', line 329 def change(value) execute_action(value) end |