Sha256: 16d2558f67680e212c68f3a0a5224ab819c4fcacf1bf335f690f18486ff701e2

Contents?: true

Size: 237 Bytes

Versions: 14

Compression:

Stored size: 237 Bytes

Contents

class String
  def underscored
    self.gsub(/([A-Z])/, '_\1').downcase
  end
  
  def lower_camelized
    self.gsub(/(_)(.)/) { $2.upcase }
  end
  
  def to_ga
    "ga:#{self}"
  end

  def from_ga
    self.gsub(/^ga\:/, '')
  end
end

Version data entries

14 entries across 14 versions & 4 rubygems

Version Path
jonuts-garb-0.2.4 lib/extensions/string.rb
jonuts-garb-0.2.6 lib/extensions/string.rb
macros-garb-0.2.6 lib/extensions/string.rb
vigetlabs-garb-0.2.4 lib/extensions/string.rb
vigetlabs-garb-0.2.5 lib/extensions/string.rb
vigetlabs-garb-0.2.6 lib/extensions/string.rb
garb-0.4.0 lib/extensions/string.rb
garb-0.3.2 lib/extensions/string.rb
garb-0.3.1 lib/extensions/string.rb
garb-0.3.0 lib/extensions/string.rb
garb-0.2.9 lib/extensions/string.rb
garb-0.2.8 lib/extensions/string.rb
garb-0.2.4 lib/extensions/string.rb
garb-0.2.6 lib/extensions/string.rb