Sha256: 8ddde431d928af1b714804ed08c3940415e552dd75ee6578dc40e3f1a83bed09

Contents?: true

Size: 435 Bytes

Versions: 42

Compression:

Stored size: 435 Bytes

Contents

# -*- encoding : utf-8 -*-
# Provides const_name that returns the name of the class or module (or the name of the class
# an instance belongs to)  without it's parent namespace. Useful for building module tables
module Tracksperanto::ConstName
  module C
    def const_name
      to_s.split('::').pop
    end
  end
  
  def const_name
    self.class.const_name
  end
  
  def self.included(into)
    into.extend(C)
    super
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
tracksperanto-3.5.9 lib/tracksperanto/const_name.rb
tracksperanto-3.5.8 lib/tracksperanto/const_name.rb
tracksperanto-3.5.7 lib/tracksperanto/const_name.rb
tracksperanto-3.5.6 lib/tracksperanto/const_name.rb
tracksperanto-3.5.5 lib/tracksperanto/const_name.rb
tracksperanto-3.5.4 lib/tracksperanto/const_name.rb
tracksperanto-3.5.2 lib/tracksperanto/const_name.rb
tracksperanto-3.5.1 lib/tracksperanto/const_name.rb
tracksperanto-3.5.0 lib/tracksperanto/const_name.rb
tracksperanto-3.4.1 lib/tracksperanto/const_name.rb
tracksperanto-3.4.0 lib/tracksperanto/const_name.rb
tracksperanto-3.3.13 lib/tracksperanto/const_name.rb
tracksperanto-3.3.12 lib/tracksperanto/const_name.rb
tracksperanto-3.3.11 lib/tracksperanto/const_name.rb
tracksperanto-3.3.10 lib/tracksperanto/const_name.rb
tracksperanto-3.3.9 lib/tracksperanto/const_name.rb
tracksperanto-3.3.8 lib/tracksperanto/const_name.rb
tracksperanto-3.3.7 lib/tracksperanto/const_name.rb
tracksperanto-3.3.6 lib/tracksperanto/const_name.rb
tracksperanto-3.3.0.pre lib/tracksperanto/const_name.rb