Method: Unit::System#initialize

Defined in:
lib/unit/system.rb

#initialize(name) {|_self| ... } ⇒ System

Returns a new instance of System.

Yields:

  • (_self)

Yield Parameters:

  • _self (Unit::System)

    the object that the method was called on



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/unit/system.rb', line 8

def initialize(name)
  @name = name
  @unit = {}
  @unit_symbol = {}

  # one is internal trivial factor
  @factor = {:one => {:symbol => 'one', :value => 1} }
  @factor_symbol = {'one' => :one}
  @factor_value = {1 => :one}

  @loaded_systems = []
  @loaded_filenames = []

  yield(self) if block_given?
end