Class: PseudoHiki::BlockParser::NestedBlockLeaf

Inherits:
BlockLeaf
  • Object
show all
Defined in:
lib/pseudohiki/blockparser.rb

Direct Known Subclasses

ListTypeLeaf

Instance Attribute Summary

Attributes inherited from BlockLeaf

#level, #node_id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BlockLeaf

#block, #head_re, #parse_leafs, #push_block, #under_appropriate_block?

Class Method Details

.create(line) ⇒ Object



111
112
113
114
# File 'lib/pseudohiki/blockparser.rb', line 111

def self.create(line)
  m = head_re.match(line)
  super(line).tap {|leaf| leaf.level = m[0].length }
end

.with_depth?Boolean

Returns:

  • (Boolean)


116
117
118
# File 'lib/pseudohiki/blockparser.rb', line 116

def self.with_depth?
  true
end

Instance Method Details

#push_self(stack) ⇒ Object



120
121
122
123
# File 'lib/pseudohiki/blockparser.rb', line 120

def push_self(stack)
  super(stack)
  BlockParser.assign_node_id(self[0], self)
end