Method: Icss::Meta::Type.fullname_for

Defined in:
lib/icss/type.rb

.fullname_for(klass_name) ⇒ Object

Turns a type name into its dotted (avro-style) name, regardless of its current form.

Examples:

Icss::Meta::Type.fullname_for(Icss::This::That::TheOther)   # 'this.that.the_other'
Icss::Meta::Type.fullname_for("Icss::This::That::TheOther") # 'this.that.the_other'
Icss::Meta::Type.fullname_for('this.that.the_other')        # 'this.that.the_other'


125
126
127
128
# File 'lib/icss/type.rb', line 125

def self.fullname_for(klass_name)
  return nil unless klass_name.present? && (klass_name.to_s =~ NORMAL_NAMED_CONSTANT_RE)
  klass_name.to_s.gsub(/^:*Icss::/, '').underscore.gsub(%r{/},".")
end