Module: StringInflection::Method
- Included in:
- StringInflection::Methods::Camel, StringInflection::Methods::Kebab, StringInflection::Methods::Pascal, StringInflection::Methods::Plural, StringInflection::Methods::Singular, StringInflection::Methods::Snake
- Defined in:
- lib/string_inflection/method.rb
Instance Method Summary collapse
Instance Method Details
#[](options) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/string_inflection/method.rb', line 3 def []() name = [:name] mod_name = "NAMES_#{name}" return const_get(mod_name) if const_defined?(mod_name) mod = Module.new const_set mod_name, mod mod.__send__ :define_method, name, &@method_definition mod end |