Sha256: dd4e6eb7b810a09cf99f6019850d7d51e4eee98189b4998f011ca64d3d096d3b
Contents?: true
Size: 1.52 KB
Versions: 2
Compression:
Stored size: 1.52 KB
Contents
class FelFlame class Helper =begin # Unused: class Level < FelFlame::Helper::ComponentManager class <<self def data @data ||= { add: [], remove: [], grid: FelFlame::Helper::Array2D.new } end def add(entity_id) super data[:add].push entity_id end def remove(entity_id) data[:remove].push entity_id super end end end =end =begin class Array2D < Array def [](val) unless val.nil? return self[val] = [] if super.nil? end super end end =end =begin class ArrayOfHashes < Array def [](val) unless val.nil? return self[val] = {} if super.nil? end super end end =end =begin module ComponentHelper class <<self def up? char char == char.upcase end def down? char char == char.downcase end def underscore(input) output = input[0].downcase (1...(input.length - 1)).each do |iter| if down?(input[iter]) && up?(input[iter + 1]) output += "#{input[iter].downcase}_" elsif up?(input[iter - 1]) && up?(input[iter]) && down?(input[iter + 1]) output += "_#{input[iter].downcase}" else output += input[iter].downcase end end output += input[-1].downcase unless input.length == 1 output end end end =end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
felflame-1.0.1 | deprecated/helpers/01_component.rb |
felflame-1.0.0 | deprecated/helpers/01_component.rb |