Class: HakumiComponents::Documentation::Section
- Inherits:
-
Object
- Object
- HakumiComponents::Documentation::Section
- Extended by:
- T::Sig
- Defined in:
- lib/hakumi_components/documentation/models.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#methods ⇒ Object
readonly
Returns the value of attribute methods.
-
#props ⇒ Object
readonly
Returns the value of attribute props.
-
#slots ⇒ Object
readonly
Returns the value of attribute slots.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(title:, description: nil, props: [], methods: [], events: [], slots: []) ⇒ Section
constructor
A new instance of Section.
- #to_h ⇒ Object
Constructor Details
#initialize(title:, description: nil, props: [], methods: [], events: [], slots: []) ⇒ Section
Returns a new instance of Section.
112 113 114 115 116 117 118 119 |
# File 'lib/hakumi_components/documentation/models.rb', line 112 def initialize(title:, description: nil, props: [], methods: [], events: [], slots: []) @title = title @description = description @props = props @methods = methods @events = events @slots = slots end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
125 126 127 |
# File 'lib/hakumi_components/documentation/models.rb', line 125 def description @description end |
#events ⇒ Object (readonly)
Returns the value of attribute events.
134 135 136 |
# File 'lib/hakumi_components/documentation/models.rb', line 134 def events @events end |
#methods ⇒ Object (readonly)
Returns the value of attribute methods.
131 132 133 |
# File 'lib/hakumi_components/documentation/models.rb', line 131 def methods @methods end |
#props ⇒ Object (readonly)
Returns the value of attribute props.
128 129 130 |
# File 'lib/hakumi_components/documentation/models.rb', line 128 def props @props end |
#slots ⇒ Object (readonly)
Returns the value of attribute slots.
137 138 139 |
# File 'lib/hakumi_components/documentation/models.rb', line 137 def slots @slots end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
122 123 124 |
# File 'lib/hakumi_components/documentation/models.rb', line 122 def title @title end |
Instance Method Details
#to_h ⇒ Object
140 141 142 143 144 145 146 147 148 149 |
# File 'lib/hakumi_components/documentation/models.rb', line 140 def to_h { "title" => @title, "description" => @description, "props" => @props.map(&:to_h), "methods" => @methods.map(&:to_h), "events" => @events.map(&:to_h), "slots" => @slots.map(&:to_h) } end |