Class: DressCode::Document
- Inherits:
-
Object
- Object
- DressCode::Document
- Defined in:
- lib/dress_code/document.rb
Constant Summary collapse
- MD =
Redcarpet::Markdown.new(DressCode::Renderer.new, { fenced_code_blocks: true, strikethrough: true, superscript: true })
Instance Attribute Summary collapse
-
#component ⇒ Object
Returns the value of attribute component.
-
#path ⇒ Object
Returns the value of attribute path.
-
#prose ⇒ Object
Returns the value of attribute prose.
-
#relative_path ⇒ Object
Returns the value of attribute relative_path.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Document
constructor
A new instance of Document.
- #to_html ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Document
Returns a new instance of Document.
14 15 16 17 18 19 20 |
# File 'lib/dress_code/document.rb', line 14 def initialize(attributes) @attributes = attributes @path = @attributes[:path] @relative_path = @attributes[:relative_path] @prose = @attributes[:prose] @component = @attributes[:component] end |
Instance Attribute Details
#component ⇒ Object
Returns the value of attribute component.
12 13 14 |
# File 'lib/dress_code/document.rb', line 12 def component @component end |
#path ⇒ Object
Returns the value of attribute path.
12 13 14 |
# File 'lib/dress_code/document.rb', line 12 def path @path end |
#prose ⇒ Object
Returns the value of attribute prose.
12 13 14 |
# File 'lib/dress_code/document.rb', line 12 def prose @prose end |
#relative_path ⇒ Object
Returns the value of attribute relative_path.
12 13 14 |
# File 'lib/dress_code/document.rb', line 12 def relative_path @relative_path end |
Instance Method Details
#to_html ⇒ Object
22 23 24 |
# File 'lib/dress_code/document.rb', line 22 def to_html MD.render(@prose) end |