Class: MarkdownComposer::SourceListBuilder
- Inherits:
-
Object
- Object
- MarkdownComposer::SourceListBuilder
- Defined in:
- lib/markdown_composer/source_list_builder.rb
Instance Method Summary collapse
- #current(markdown = nil, key: "current", html: nil, title: nil, preferred_format: :markdown, metadata: {}) ⇒ Object
- #explicit(key, markdown = nil, html: nil, title: nil, preferred_format: :markdown, metadata: {}) ⇒ Object
- #inherited(key, markdown = nil, html: nil, title: nil, preferred_format: :markdown, metadata: {}) ⇒ Object
-
#initialize ⇒ SourceListBuilder
constructor
A new instance of SourceListBuilder.
- #to_a ⇒ Object
Constructor Details
#initialize ⇒ SourceListBuilder
Returns a new instance of SourceListBuilder.
5 6 7 |
# File 'lib/markdown_composer/source_list_builder.rb', line 5 def initialize @sources = [] end |
Instance Method Details
#current(markdown = nil, key: "current", html: nil, title: nil, preferred_format: :markdown, metadata: {}) ⇒ Object
9 10 11 |
# File 'lib/markdown_composer/source_list_builder.rb', line 9 def current(markdown = nil, key: "current", html: nil, title: nil, preferred_format: :markdown, metadata: {}) add(type: "current", key: key, markdown: markdown, html: html, title: title, preferred_format: preferred_format, metadata: ) end |
#explicit(key, markdown = nil, html: nil, title: nil, preferred_format: :markdown, metadata: {}) ⇒ Object
13 14 15 |
# File 'lib/markdown_composer/source_list_builder.rb', line 13 def explicit(key, markdown = nil, html: nil, title: nil, preferred_format: :markdown, metadata: {}) add(type: "explicit", key: key, markdown: markdown, html: html, title: title, preferred_format: preferred_format, metadata: ) end |
#inherited(key, markdown = nil, html: nil, title: nil, preferred_format: :markdown, metadata: {}) ⇒ Object
17 18 19 |
# File 'lib/markdown_composer/source_list_builder.rb', line 17 def inherited(key, markdown = nil, html: nil, title: nil, preferred_format: :markdown, metadata: {}) add(type: "inherited", key: key, markdown: markdown, html: html, title: title, preferred_format: preferred_format, metadata: ) end |
#to_a ⇒ Object
21 22 23 |
# File 'lib/markdown_composer/source_list_builder.rb', line 21 def to_a @sources.map(&:dup) end |