Class: MarkdownComposer::Result
- Inherits:
-
Object
- Object
- MarkdownComposer::Result
- Defined in:
- lib/markdown_composer/result.rb
Instance Attribute Summary collapse
-
#buffer ⇒ Object
readonly
Returns the value of attribute buffer.
-
#diagnostics ⇒ Object
readonly
Returns the value of attribute diagnostics.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#html ⇒ Object
readonly
Returns the value of attribute html.
-
#markdown ⇒ Object
readonly
Returns the value of attribute markdown.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#stages ⇒ Object
readonly
Returns the value of attribute stages.
Instance Method Summary collapse
-
#initialize(output:, buffer:, markdown:, html:, diagnostics:, errors:, stages: {}) ⇒ Result
constructor
A new instance of Result.
- #success? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(output:, buffer:, markdown:, html:, diagnostics:, errors:, stages: {}) ⇒ Result
Returns a new instance of Result.
7 8 9 10 11 12 13 14 15 |
# File 'lib/markdown_composer/result.rb', line 7 def initialize(output:, buffer:, markdown:, html:, diagnostics:, errors:, stages: {}) @output = output @buffer = buffer @markdown = markdown @html = html @diagnostics = diagnostics @errors = errors @stages = stages end |
Instance Attribute Details
#buffer ⇒ Object (readonly)
Returns the value of attribute buffer.
5 6 7 |
# File 'lib/markdown_composer/result.rb', line 5 def buffer @buffer end |
#diagnostics ⇒ Object (readonly)
Returns the value of attribute diagnostics.
5 6 7 |
# File 'lib/markdown_composer/result.rb', line 5 def diagnostics @diagnostics end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
5 6 7 |
# File 'lib/markdown_composer/result.rb', line 5 def errors @errors end |
#html ⇒ Object (readonly)
Returns the value of attribute html.
5 6 7 |
# File 'lib/markdown_composer/result.rb', line 5 def html @html end |
#markdown ⇒ Object (readonly)
Returns the value of attribute markdown.
5 6 7 |
# File 'lib/markdown_composer/result.rb', line 5 def markdown @markdown end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
5 6 7 |
# File 'lib/markdown_composer/result.rb', line 5 def output @output end |
#stages ⇒ Object (readonly)
Returns the value of attribute stages.
5 6 7 |
# File 'lib/markdown_composer/result.rb', line 5 def stages @stages end |
Instance Method Details
#success? ⇒ Boolean
17 18 19 |
# File 'lib/markdown_composer/result.rb', line 17 def success? errors.empty? end |
#to_h ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/markdown_composer/result.rb', line 21 def to_h { success: success?, output: output, buffer: buffer&.to_h, markdown: markdown, html: html, diagnostics: diagnostics.map(&:to_h), errors: errors.map(&:to_h), stages: stages } end |