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.
486 487 488 489 490 491 |
# File 'lib/sandals/view.rb', line 486 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.
484 485 486 |
# File 'lib/sandals/view.rb', line 484 def id @id end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
484 485 486 |
# File 'lib/sandals/view.rb', line 484 def label @label end |
Instance Method Details
#change(file) ⇒ Object
493 494 495 |
# File 'lib/sandals/view.rb', line 493 def change(file) execute_action(file) end |