Class: MarkdownParserService::ListExtractor

Inherits:
Redcarpet::Render::Base
  • Object
show all
Defined in:
lib/renuo/cli/app/services/markdown_parser_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#filesObject (readonly)

Returns the value of attribute files.



5
6
7
# File 'lib/renuo/cli/app/services/markdown_parser_service.rb', line 5

def files
  @files
end

Instance Method Details

#list(_contents, _list_type) ⇒ Object



7
8
9
10
# File 'lib/renuo/cli/app/services/markdown_parser_service.rb', line 7

def list(_contents, _list_type)
  @next_is_hint = true
  ''
end

#list_item(text, _list_type) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/renuo/cli/app/services/markdown_parser_service.rb', line 12

def list_item(text, _list_type)
  @files ||= []
  if @next_is_hint
    @files.last.unshift text.strip
    @next_is_hint = false
  else
    @files << [text.strip]
  end
  ''
end