Method: Fort::Type::Base#initialize

Defined in:
lib/fort/type.rb

#initialize(id, params = {}) ⇒ Base

Returns a new instance of Base.

Raises:

  • (ArgumentError)


40
41
42
43
44
45
# File 'lib/fort/type.rb', line 40

def initialize(id, params = {})
  @id = id
  @dim = params.fetch(:dim)
  raise ArgumentError, "@dim: #{@dim}" if @dim < 0
  @type = self.class.to_s.split('::').last.to_sym
end