module Topping

Constants

VERSION

Public Class Methods

build() click to toggle source
# File lib/topping.rb, line 15
def build
  root.build
end
root() click to toggle source
# File lib/topping.rb, line 11
def root
  @@root
end
underscore(str) click to toggle source
# File lib/topping.rb, line 25
def underscore(str)
  str.gsub(/::/, '/').
    gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
    gsub(/([a-z\d])([A-Z])/, '\1_\2').
    tr('-', '_').
    downcase
end
underscore_namespace(klass) click to toggle source
# File lib/topping.rb, line 19
def underscore_namespace(klass)
  klass.name.split('::').map do |key|
    Topping.underscore(key)
  end
end