Class: MCMarkdown::Parser::BlockTag::Block

Inherits:
Object
  • Object
show all
Defined in:
lib/mc_markdown/parsers/block_tag.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ Block

Returns a new instance of Block.



55
56
57
# File 'lib/mc_markdown/parsers/block_tag.rb', line 55

def initialize content
  @orig = content
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



53
54
55
# File 'lib/mc_markdown/parsers/block_tag.rb', line 53

def attributes
  @attributes
end

#origObject (readonly)

Returns the value of attribute orig.



51
52
53
# File 'lib/mc_markdown/parsers/block_tag.rb', line 51

def orig
  @orig
end

#typeObject (readonly)

Returns the value of attribute type.



52
53
54
# File 'lib/mc_markdown/parsers/block_tag.rb', line 52

def type
  @type
end

Class Method Details

.close_blockObject



31
32
33
# File 'lib/mc_markdown/parsers/block_tag.rb', line 31

def close_block
  / (?:#{open_tag})? #{repeated_spaces} \{\{\/(.+?)\}\} (?:#{close_tag})? /x
end

.close_tagObject



39
40
41
# File 'lib/mc_markdown/parsers/block_tag.rb', line 39

def close_tag
  / < (?:\/) (?:\w+?) > /x
end

.open_blockObject



27
28
29
# File 'lib/mc_markdown/parsers/block_tag.rb', line 27

def open_block
  / (?:#{open_tag})? \{\{(.+?)\}\} #{repeated_spaces} (?:#{close_tag})? /x
end

.open_tagObject



35
36
37
# File 'lib/mc_markdown/parsers/block_tag.rb', line 35

def open_tag
  / < (?:\w+?) > /x
end

.patternObject



23
24
25
# File 'lib/mc_markdown/parsers/block_tag.rb', line 23

def pattern
  / #{open_block} (.*?) #{close_block} /xm
end