Module: HTOTConv::Parser

Defined in:
lib/htot_conv/parser.rb,
lib/htot_conv/parser/base.rb,
lib/htot_conv/parser/html_list.rb,
lib/htot_conv/parser/simple_text.rb

Defined Under Namespace

Classes: Base, HtmlList, SimpleText

Class Method Summary collapse

Class Method Details

.create(type, *args) ⇒ Object



7
8
9
10
# File 'lib/htot_conv/parser.rb', line 7

def create(type, *args)
  klass = HTOTConv::Parser.const_get(Rinne.camelize(type.to_s))
  klass.new(*args)
end

.typesObject



13
14
15
16
17
18
19
20
21
# File 'lib/htot_conv/parser.rb', line 13

def types
  HTOTConv::Parser.constants.reject { |klass|
    klass =~ /Base$/
  }.select { |klass|
    HTOTConv::Parser.const_get(klass).kind_of?(Class)
  }.map { |klass|
    Rinne.to_snake(klass.to_s).to_sym
  }
end