Class: HakumiComponents::Documentation::Example
- Inherits:
-
Object
- Object
- HakumiComponents::Documentation::Example
- Extended by:
- T::Sig
- Defined in:
- lib/hakumi_components/documentation/models.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#sandbox ⇒ Object
readonly
Returns the value of attribute sandbox.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(name:, title:, description: nil, sandbox: false, content: nil) ⇒ Example
constructor
A new instance of Example.
- #to_h ⇒ Object
- #with_content(content) ⇒ Object
Constructor Details
#initialize(name:, title:, description: nil, sandbox: false, content: nil) ⇒ Example
Returns a new instance of Example.
164 165 166 167 168 169 170 |
# File 'lib/hakumi_components/documentation/models.rb', line 164 def initialize(name:, title:, description: nil, sandbox: false, content: nil) @name = name @title = title @description = description @sandbox = sandbox @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
185 186 187 |
# File 'lib/hakumi_components/documentation/models.rb', line 185 def content @content end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
179 180 181 |
# File 'lib/hakumi_components/documentation/models.rb', line 179 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
173 174 175 |
# File 'lib/hakumi_components/documentation/models.rb', line 173 def name @name end |
#sandbox ⇒ Object (readonly)
Returns the value of attribute sandbox.
182 183 184 |
# File 'lib/hakumi_components/documentation/models.rb', line 182 def sandbox @sandbox end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
176 177 178 |
# File 'lib/hakumi_components/documentation/models.rb', line 176 def title @title end |
Instance Method Details
#to_h ⇒ Object
199 200 201 202 203 204 205 206 207 |
# File 'lib/hakumi_components/documentation/models.rb', line 199 def to_h { "name" => @name, "title" => @title, "description" => @description, "sandbox" => @sandbox, "content" => @content } end |
#with_content(content) ⇒ Object
188 189 190 191 192 193 194 195 196 |
# File 'lib/hakumi_components/documentation/models.rb', line 188 def with_content(content) self.class.new( name: @name, title: @title, description: @description, sandbox: @sandbox, content: content ) end |