Class: Coradoc::Document::Block

Inherits:
Object
  • Object
show all
Defined in:
lib/coradoc/document/block.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, options = {}) ⇒ Block

Returns a new instance of Block.



5
6
7
8
9
10
11
# File 'lib/coradoc/document/block.rb', line 5

def initialize(title, options = {})
  @title = title
  @lines = options.fetch(:lines, [])
  @type_str = options.fetch(:type, nil)
  @delimiter = options.fetch(:delimiter, "")
  @attributes = options.fetch(:attributes, {})
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



3
4
5
# File 'lib/coradoc/document/block.rb', line 3

def attributes
  @attributes
end

#linesObject (readonly)

Returns the value of attribute lines.



3
4
5
# File 'lib/coradoc/document/block.rb', line 3

def lines
  @lines
end

#titleObject (readonly)

Returns the value of attribute title.



3
4
5
# File 'lib/coradoc/document/block.rb', line 3

def title
  @title
end

Instance Method Details

#typeObject



13
14
15
# File 'lib/coradoc/document/block.rb', line 13

def type
  @type ||= defined_type || type_from_delimiter
end