Class: Polaris::Action
- Inherits:
-
Object
- Object
- Polaris::Action
- Defined in:
- app/components/polaris/action.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Instance Method Summary collapse
-
#initialize(content:, url:, accessibility_label: "", external: false, id: "", data: {}) ⇒ Action
constructor
A new instance of Action.
- #to_h ⇒ Object
Constructor Details
#initialize(content:, url:, accessibility_label: "", external: false, id: "", data: {}) ⇒ Action
Returns a new instance of Action.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/components/polaris/action.rb', line 5 def initialize( content:, url:, accessibility_label: "", external: false, id: "", data: {} ) @content = content @accessibility_label = accessibility_label @external = external @id = id @url = url @data = data end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
3 4 5 |
# File 'app/components/polaris/action.rb', line 3 def content @content end |
Instance Method Details
#to_h ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'app/components/polaris/action.rb', line 21 def to_h { content: @content, accessibility_label: @accessibility_label, external: @external, id: @id, url: @url, data: @data } end |