Class: Typesmith::ArrayProperty

Inherits:
SimpleProperty show all
Defined in:
lib/typesmith/array_property.rb

Constant Summary

Constants inherited from BaseProperty

BaseProperty::PRIMITIVE_TYPES

Instance Attribute Summary

Attributes inherited from SimpleProperty

#type

Attributes inherited from BaseProperty

#name, #optional

Instance Method Summary collapse

Methods inherited from SimpleProperty

#initialize

Methods inherited from BaseProperty

#initialize

Constructor Details

This class inherits a constructor from Typesmith::SimpleProperty

Instance Method Details

#process_value(value) ⇒ Object



9
10
11
# File 'lib/typesmith/array_property.rb', line 9

def process_value(value)
  value.map { |v| super(v) }
end

#to_typescriptObject



5
6
7
# File 'lib/typesmith/array_property.rb', line 5

def to_typescript
  "#{camelized_name}#{optional_suffix}: #{get_type_string(type)}[];"
end