Class: Sandals::Button
- Inherits:
-
Object
- Object
- Sandals::Button
- Includes:
- Actionable, Styled
- Defined in:
- lib/sandals/view.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Attributes included from Styled
Instance Method Summary collapse
- #activate ⇒ Object
-
#initialize(id, content, action:, styles: {}) ⇒ Button
constructor
A new instance of Button.
Constructor Details
#initialize(id, content, action:, styles: {}) ⇒ Button
Returns a new instance of Button.
504 505 506 507 508 509 |
# File 'lib/sandals/view.rb', line 504 def initialize(id, content, action:, styles: {}) @id = id @content = content.to_s @action = action initialize_styles(styles) end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
502 503 504 |
# File 'lib/sandals/view.rb', line 502 def content @content end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
502 503 504 |
# File 'lib/sandals/view.rb', line 502 def id @id end |
Instance Method Details
#activate ⇒ Object
511 512 513 |
# File 'lib/sandals/view.rb', line 511 def activate execute_action end |