Sha256: c4c459dd07a2a0fac47a15826b18a9f12b89eeff6864bd7f3820ce5a1e76cba9

Contents?: true

Size: 230 Bytes

Versions: 13

Compression:

Stored size: 230 Bytes

Contents

class Symbol

  # Prepend an "@" to the beginning of a symbol
  # to make a instance variable name. This also replaces
  # non-valid characters with underscores.

  def variablize
    "@#{self}".gsub(/\W/, '_').to_sym
  end

end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
facets-2.8.4 lib/core/facets/symbol/variablize.rb
facets-2.8.3 lib/core/facets/symbol/variablize.rb
facets-2.8.2 lib/core/facets/symbol/variablize.rb
facets-2.8.1 lib/core/facets/symbol/variablize.rb
facets-2.8.0 lib/core/facets/symbol/variablize.rb
facets-2.7.0 lib/core/facets/symbol/variablize.rb
facets-2.6.0 lib/core/facets/symbol/variablize.rb
facets-2.4.4 lib/core/facets/symbol/variablize.rb
facets-2.5.1 lib/core/facets/symbol/variablize.rb
facets-2.5.0 lib/core/facets/symbol/variablize.rb
facets-2.4.5 lib/core/facets/symbol/variablize.rb
facets-2.5.2 lib/core/facets/symbol/variablize.rb
mack-facets-0.8.2 lib/gems/facets-2.4.5/lib/core/facets/symbol/variablize.rb