Class: Sandals::Button

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

Direct Known Subclasses

Submit

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, content, action:) ⇒ Button

Returns a new instance of Button.



481
482
483
484
485
# File 'lib/sandals/view.rb', line 481

def initialize(id, content, action:)
  @id = id
  @content = content.to_s
  @action = action
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



479
480
481
# File 'lib/sandals/view.rb', line 479

def content
  @content
end

#idObject (readonly)

Returns the value of attribute id.



479
480
481
# File 'lib/sandals/view.rb', line 479

def id
  @id
end

Instance Method Details

#activateObject



487
488
489
# File 'lib/sandals/view.rb', line 487

def activate
  execute_action
end