2013-09-20 06:29:09 +00:00
|
|
|
class Class
|
2013-09-21 22:50:23 +00:00
|
|
|
def to_app_model_url
|
2015-05-07 12:10:38 +00:00
|
|
|
camel_cased_word = to_s
|
2015-04-30 17:51:31 +00:00
|
|
|
camel_cased_word.gsub(/::/, '_')
|
|
|
|
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
|
|
|
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
|
|
|
.tr('-', '_')
|
|
|
|
.downcase
|
2013-09-20 06:29:09 +00:00
|
|
|
end
|
2015-05-07 10:27:12 +00:00
|
|
|
|
2013-09-21 22:50:23 +00:00
|
|
|
def to_app_model
|
2015-05-07 12:10:38 +00:00
|
|
|
camel_cased_word = to_s
|
2013-09-21 22:50:23 +00:00
|
|
|
camel_cased_word.gsub(/::/, '').to_sym
|
2013-09-21 22:40:19 +00:00
|
|
|
end
|
2015-04-27 14:15:29 +00:00
|
|
|
end
|