module Stunted::Stutils

Public Instance Methods

F(hash = {}, *shapes) click to toggle source
# File lib/stunted/stutils.rb, line 3
def F(hash = {}, *shapes)
  FunctionalHash.new(hash).become(*shapes)
end
Fall(tuples, *args) click to toggle source
# File lib/stunted/stutils.rb, line 11
def Fall(tuples, *args)
  first = args.first
  if first.is_a?(Hash)
    array_shapes = first[:array] || []
    hash_shapes = first[:hash] || []
  else
    hash_shapes = args
    array_shapes = []
  end
  HashArray.new(tuples.map { | row | F(row, *hash_shapes) }).
            become(*array_shapes)
end
Fonly(tuples, *shapes) click to toggle source
# File lib/stunted/stutils.rb, line 7
def Fonly(tuples, *shapes)
  F(tuples.first, *shapes)
end