Class: Markdownplus::Block
- Inherits:
-
Object
- Object
- Markdownplus::Block
- Defined in:
- lib/markdownplus/parser.rb
Instance Attribute Summary collapse
-
#block_number ⇒ Object
readonly
Returns the value of attribute block_number.
Instance Method Summary collapse
- #append(line) ⇒ Object
- #errors ⇒ Object
-
#initialize(block_number) ⇒ Block
constructor
A new instance of Block.
- #input ⇒ Object
- #input=(value) ⇒ Object
- #lines ⇒ Object
- #warnings ⇒ Object
Constructor Details
#initialize(block_number) ⇒ Block
Returns a new instance of Block.
105 106 107 |
# File 'lib/markdownplus/parser.rb', line 105 def initialize(block_number) @block_number = block_number end |
Instance Attribute Details
#block_number ⇒ Object (readonly)
Returns the value of attribute block_number.
104 105 106 |
# File 'lib/markdownplus/parser.rb', line 104 def block_number @block_number end |
Instance Method Details
#append(line) ⇒ Object
120 121 122 |
# File 'lib/markdownplus/parser.rb', line 120 def append(line) self.input += "#{line}\n" end |
#errors ⇒ Object
124 125 126 |
# File 'lib/markdownplus/parser.rb', line 124 def errors @errors ||= [] end |
#input ⇒ Object
109 110 111 |
# File 'lib/markdownplus/parser.rb', line 109 def input @input ||= "" end |
#input=(value) ⇒ Object
112 113 114 |
# File 'lib/markdownplus/parser.rb', line 112 def input=(value) @input = value end |
#lines ⇒ Object
116 117 118 |
# File 'lib/markdownplus/parser.rb', line 116 def lines self.input.split("\n") end |
#warnings ⇒ Object
128 129 130 |
# File 'lib/markdownplus/parser.rb', line 128 def warnings @warnings ||= [] end |