exclude?

exclude?(string) Instance Public methods The inverse of String#include?. Returns true if the string does not include the other string. "hello".exclude? "lo" # => false "hello".exclude? "ol" # => true "hello".exclude? ?h # => false

first

first(limit = 1) Instance Public methods Returns the first character. If a limit is supplied, returns a substring from the beginning of the string until it reaches the limit value. If the given limit is greater than or equal to the string length, returns self. str = "hello" str.first # => "h" str.first(1) # => "h" str.first(2) # => "he" str.first(0) # => "" str.first(6) # => "hello"

foreign_key

foreign_key(separate_class_name_and_id_with_underscore = true) Instance Public methods Creates a foreign key name from a class name. separate_class_name_and_id_with_underscore sets whether the method should put '_' between the name and 'id'. 'Message'.foreign_key # => "message_id" 'Message'.foreign_key(false) # => "messageid" 'Admin::Post'.foreign_key # => "post_id"

from

from(position) Instance Public methods Returns a substring from the given position to the end of the string. If the position is negative, it is counted from the end of the string. str = "hello" str.from(0) # => "hello" str.from(3) # => "lo" str.from(-2) # => "lo" You can mix it with to method and do fun things like: str = "hello" str.from(0).to(-1) # => "hello" str.from(1).to(-2) # => "ell"

html_safe

html_safe() Instance Public methods

humanize

humanize(options = {}) Instance Public methods Capitalizes the first word, turns underscores into spaces, and strips a trailing '_id' if present. Like titleize, this is meant for creating pretty output. The capitalization of the first word can be turned off by setting the optional parameter capitalize to false. By default, this parameter is true. 'employee_salary'.humanize # => "Employee salary" 'author_id'.humanize # => "Author" 'author_id'.hu

in_time_zone

in_time_zone(zone = ::Time.zone) Instance Public methods Converts String to a TimeWithZone in the current zone if Time.zone or Time.zone_default is set, otherwise converts String to a Time via #to_time

indent

indent(amount, indent_string=nil, indent_empty_lines=false) Instance Public methods Indents the lines in the receiver: <<EOS.indent(2) def some_method some_code end EOS # => def some_method some_code end The second argument, indent_string, specifies which indent string to use. The default is nil, which tells the method to make a guess by peeking at the first indented line, and fallback to a space if there is none. " foo".indent(2) # => " foo" "foo\

indent!

indent!(amount, indent_string=nil, indent_empty_lines=false) Instance Public methods Same as indent, except it indents the receiver in-place. Returns the indented string, or nil if there was nothing to indent.

inquiry

inquiry() Instance Public methods Wraps the current string in the ActiveSupport::StringInquirer class, which gives you a prettier way to test for equality. env = 'production'.inquiry env.production? # => true env.development? # => false