Module: WAG::Type

Defined in:
lib/wag/type.rb,
lib/wag/types/f32.rb,
lib/wag/types/f64.rb,
lib/wag/types/i32.rb,
lib/wag/types/i64.rb,
lib/wag/types/base.rb

Defined Under Namespace

Classes: Base, F32, F64, I32, I64

Class Method Summary collapse

Class Method Details

.from(type) ⇒ Object



13
14
15
16
17
# File 'lib/wag/type.rb', line 13

def from(type)
  return type if type.is_a?(WAG::Type::Base)

  const_get(WAG::Inflector.inflector.camelize(type.to_s)).new
end