Class: HTOTConv::Parser::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/htot_conv/parser/base.rb

Direct Known Subclasses

HtmlList, SimpleText

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(option = {}) ⇒ Base

Returns a new instance of Base.



4
5
6
# File 'lib/htot_conv/parser/base.rb', line 4

def initialize(option={})
  @option = self.class.option_help.inject({}) { |h, pair| h[pair[0]] = pair[1][:default]; h}.merge(option)
end

Instance Attribute Details

#optionObject

Returns the value of attribute option.



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

def option
  @option
end

Class Method Details

.option_helpObject



9
10
11
# File 'lib/htot_conv/parser/base.rb', line 9

def self.option_help
  {}
end