Class: Sandals::FileField
- Inherits:
-
Object
- Object
- Sandals::FileField
- 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.
Attributes included from FieldValidation
Instance Method Summary collapse
- #change(file) ⇒ Object
-
#initialize(id, label, action:, error: nil) ⇒ FileField
constructor
A new instance of FileField.
Methods included from FieldValidation
Constructor Details
#initialize(id, label, action:, error: nil) ⇒ FileField
Returns a new instance of FileField.
464 465 466 467 468 469 |
# File 'lib/sandals/view.rb', line 464 def initialize(id, label, action:, error: nil) @id = id @label = label.to_s initialize_error(error) @action = action end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
462 463 464 |
# File 'lib/sandals/view.rb', line 462 def id @id end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
462 463 464 |
# File 'lib/sandals/view.rb', line 462 def label @label end |
Instance Method Details
#change(file) ⇒ Object
471 472 473 |
# File 'lib/sandals/view.rb', line 471 def change(file) execute_action(file) end |