Class: String

### Home Classes Methods

### In Files

- lib/tw/app/helper.rb
- lib/tw/client/helper.rb

### Parent

Object

### Methods

- #char_length
- #char_length_with_t_co
- #colorize

### Class/Module Index

Quicksearch

- Tw
- Tw::App
- Tw::App::Main
- Tw::App::Render
- Tw::Auth
- Tw::Client
- Tw::Client::Stream
- Tw::Conf
- Tw::Error
- Tw::Tweet
- String

No matching classes.

# String

### Public Instance Methods

char_length() click to toggle source

    # File lib/tw/client/helper.rb, line 4
    def char_length
      self.split(//).size
    end

char_length_with_t_co() click to toggle source

    # File lib/tw/client/helper.rb, line 8
    def char_length_with_t_co
      Tw::Conf.update_twitter_config
      len = self.char_length
      self.scan(Regexp.new "https?://[^\s]+").each do |url|
        len += (url =~ /^https/ ? Tw::Conf['twitter_config']['short_url_length_https'] : Tw::Conf['twitter_config']['short_url_length']) - url.char_length
      end
      len
    end

colorize(pattern) click to toggle source

    # File lib/tw/app/helper.rb, line 3
    def colorize(pattern)
      self.split(/(#{pattern})/).map{|term|
        if term =~ /#{pattern}/
          term = term.color(Tw::App::Render.color_code term).bright.underline
        end
        term
      }.join('')
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.