Sha256: 8013b9642ea34ba58449534001e453077582d94cfc4ddebe97996e8c23ac92ea

Contents?: true

Size: 422 Bytes

Versions: 4

Compression:

Stored size: 422 Bytes

Contents

require 'facet/string/to_const'
class Symbol
  # Get a constant by a given symbol name.
  #
  #   require 'facet/symbol/to_const'
  #
  #   :Class.to_const   #=> Class
  #
  # Note this method is not as verstile as it should be,
  # since it can not access contants relative to the current 
  # execution context. But without a binding_of_caller that
  # does not seem possible.
  def to_const
    to_s.to_const
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
facets-0.6.3 lib/facet/symbol/to_const.rb
facets-0.7.0 lib/facet/symbol/to_const.rb
facets-0.7.1 lib/facet/symbol/to_const.rb
facets-0.7.2 lib/facet/symbol/to_const.rb