Class: Sandals::FileField

Inherits:
Object
  • Object
show all
Includes:
Actionable, FieldValidation
Defined in:
lib/sandals/view.rb

Instance Attribute Summary collapse

Attributes included from FieldValidation

#error

Instance Method Summary collapse

Methods included from FieldValidation

#error_id, #invalid?

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

#idObject (readonly)

Returns the value of attribute id.



462
463
464
# File 'lib/sandals/view.rb', line 462

def id
  @id
end

#labelObject (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