Class: HTOTConv::Generator::Base
- Inherits:
-
Object
- Object
- HTOTConv::Generator::Base
- Defined in:
- lib/htot_conv/generator/base.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data, option = {}) ⇒ Base
constructor
A new instance of Base.
- #output(outputfile) ⇒ Object
Constructor Details
#initialize(data, option = {}) ⇒ Base
Returns a new instance of Base.
4 5 6 7 8 |
# File 'lib/htot_conv/generator/base.rb', line 4 def initialize(data, option={}) @data = data @option = self.class.option_help.inject({}) { |h, pair| h[pair[0]] = pair[1][:default]; h}.merge(option) raise ArgumentError, "data is invalid" unless data.valid? end |
Class Method Details
.option_help ⇒ Object
9 10 11 |
# File 'lib/htot_conv/generator/base.rb', line 9 def self.option_help {} end |
Instance Method Details
#output(outputfile) ⇒ Object
13 14 15 |
# File 'lib/htot_conv/generator/base.rb', line 13 def output(outputfile) raise NotImplementedError.new("#{self.class.name}.#{__method__} is an abstract method.") end |