Class: DocsKit::LandingConfig::Feature
- Inherits:
-
Data
- Object
- Data
- DocsKit::LandingConfig::Feature
- Defined in:
- lib/docs_kit/landing_config.rb
Overview
One feature card: a lucide icon name, a title, and a short body.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(title:, icon: nil, body: nil) ⇒ Feature
constructor
A new instance of Feature.
Constructor Details
#initialize(title:, icon: nil, body: nil) ⇒ Feature
Returns a new instance of Feature.
125 126 127 |
# File 'lib/docs_kit/landing_config.rb', line 125 def initialize(title:, icon: nil, body: nil) super end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body
124 125 126 |
# File 'lib/docs_kit/landing_config.rb', line 124 def body @body end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon
124 125 126 |
# File 'lib/docs_kit/landing_config.rb', line 124 def icon @icon end |
#title ⇒ Object (readonly)
Returns the value of attribute title
124 125 126 |
# File 'lib/docs_kit/landing_config.rb', line 124 def title @title end |
Class Method Details
.from(feature) ⇒ Object
129 130 131 132 133 134 |
# File 'lib/docs_kit/landing_config.rb', line 129 def self.from(feature) return feature if feature.is_a?(self) attrs = feature.to_h.transform_keys(&:to_sym) new(icon: attrs[:icon], title: attrs[:title], body: attrs[:body]) end |