Class: Sandals::TextArea

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, value:, action:, error: nil) ⇒ TextArea

Returns a new instance of TextArea.



369
370
371
372
373
374
375
# File 'lib/sandals/view.rb', line 369

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

#idObject (readonly)

Returns the value of attribute id.



367
368
369
# File 'lib/sandals/view.rb', line 367

def id
  @id
end

#labelObject (readonly)

Returns the value of attribute label.



367
368
369
# File 'lib/sandals/view.rb', line 367

def label
  @label
end

#valueObject (readonly)

Returns the value of attribute value.



367
368
369
# File 'lib/sandals/view.rb', line 367

def value
  @value
end

Instance Method Details

#change(value) ⇒ Object



377
378
379
# File 'lib/sandals/view.rb', line 377

def change(value)
  execute_action(value)
end