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.



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

def files
  @files
end

Instance Method Details

#list(_contents, _list_type) ⇒ Object



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

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

#list_item(text, _list_type) ⇒ Object



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

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