ruby

March 10, 2016 ยท View on GitHub

Ruby equivalents used for pseudo types and concepts:

PseudoRuby
List[T]Array
Dictionary[K, V]Hash
Set[T]Set
Tuple[T1, T2..]Array
ArrayArray
IntInt
FloatFloat
StringString, Symbol
for-loops.each, .each_with_index
classesclasses
methodsmethods
functionsmethods in global scope

niceties

  • Converting class attributes to attr_accessor / attr_reader / attr_writer after analyzing their usage with AttrAccessAnalyzeMiddleware

  • Expressing array literals with ruby-specific magnificient %w / %q etc syntax based on their element types :

%w(ha oh well) 
%q(look at me fancy)