Class: Metanorma::Mirror::Model::Guide
- Inherits:
-
Object
- Object
- Metanorma::Mirror::Model::Guide
- Defined in:
- lib/metanorma/mirror/model/guide.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(content:, meta: {}, title: nil) ⇒ Guide
constructor
A new instance of Guide.
- #to_h ⇒ Object
Constructor Details
#initialize(content:, meta: {}, title: nil) ⇒ Guide
Returns a new instance of Guide.
9 10 11 12 13 |
# File 'lib/metanorma/mirror/model/guide.rb', line 9 def initialize(content:, meta: {}, title: nil) @content = content @meta = @title = title end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
7 8 9 |
# File 'lib/metanorma/mirror/model/guide.rb', line 7 def content @content end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
7 8 9 |
# File 'lib/metanorma/mirror/model/guide.rb', line 7 def @meta end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
7 8 9 |
# File 'lib/metanorma/mirror/model/guide.rb', line 7 def title @title end |
Instance Method Details
#to_h ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/metanorma/mirror/model/guide.rb', line 15 def to_h h = {} h["content"] = @content.is_a?(Container) ? @content.to_h : @content h["meta"] = @meta unless @meta.nil? || @meta.empty? h["title"] = @title if @title h end |