Class: Docspec::Document
- Inherits:
-
Object
- Object
- Docspec::Document
- Includes:
- Testable
- Defined in:
- lib/docspec/document.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#markdown ⇒ Object
readonly
Returns the value of attribute markdown.
Class Method Summary collapse
Instance Method Summary collapse
- #before ⇒ Object
- #examples ⇒ Object
-
#initialize(markdown) ⇒ Document
constructor
A new instance of Document.
Methods included from Testable
#failed_examples, #success?, #test
Constructor Details
#initialize(markdown) ⇒ Document
Returns a new instance of Document.
10 11 12 |
# File 'lib/docspec/document.rb', line 10 def initialize(markdown) @markdown = markdown end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
4 5 6 |
# File 'lib/docspec/document.rb', line 4 def filename @filename end |
#markdown ⇒ Object (readonly)
Returns the value of attribute markdown.
4 5 6 |
# File 'lib/docspec/document.rb', line 4 def markdown @markdown end |
Class Method Details
.from_file(filename) ⇒ Object
6 7 8 |
# File 'lib/docspec/document.rb', line 6 def self.from_file(filename) new File.read(filename) end |
Instance Method Details
#before ⇒ Object
18 19 20 |
# File 'lib/docspec/document.rb', line 18 def before @before ||= {} end |
#examples ⇒ Object
14 15 16 |
# File 'lib/docspec/document.rb', line 14 def examples @examples ||= examples! end |