Class: HTOTConv::Generator::Base

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

Direct Known Subclasses

XlsxBase

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, option = {}) ⇒ Base

Returns a new instance of Base.

Raises:

  • (ArgumentError)


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_helpObject



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

def self.option_help
  {}
end

Instance Method Details

#output(outputfile) ⇒ Object

Raises:

  • (NotImplementedError)


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