strip_heredoc

strip_heredoc() Instance Public methods Strips indentation in heredocs. For example in if options[:usage] puts <<-USAGE.strip_heredoc This command does such and such. Supported options are: -h This message ... USAGE end the user would see the usage message aligned against the left margin. Technically, it looks for the least indented line in the whole string, and removes that amount of leading whitespace.

internal_methods

internal_methods() Class Public methods A list of all internal methods for a controller. This finds the first abstract superclass of a controller, and gets a list of all public instance methods on that abstract class. Public instance methods of a controller would normally be considered action methods, so methods declared on abstract classes are being removed. (ActionController::Metal and ActionController::Base are defined as abstract)

clear

clear() Instance Public methods

find

find(*args) Instance Public methods Find by id - This can either be a specific id (1), a list of ids (1, 5, 6), or an array of ids ([5, 6, 10]). If no record can be found for all of the listed ids, then RecordNotFound will be raised. If the primary key is an integer, find by id coerces its arguments using to_i. Person.find(1) # returns the object for ID = 1 Person.find("1") # returns the object for ID = 1 Person.find("31-sarah") # returns the object for ID = 31 Pers

sanitize

sanitize(html, options = {}) Instance Public methods This sanitize helper will html encode all tags and strip all attributes that aren't specifically allowed. It also strips href/src tags with invalid protocols, like javascript: especially. It does its best to counter any tricks that hackers may use, like throwing in unicode/ascii/hex values to get past the javascript: filters. Check out the extensive test suite. <%= sanitize @article.body %> You can add or remove tags/attri

assert_select_encoded

assert_select_encoded(element = nil, &block) Instance Public methods Extracts the content of an element, treats it as encoded HTML and runs nested assertion on it. You typically call this method within another assertion to operate on all currently selected elements. You can also pass an element or array of elements. The content of each element is un-encoded, and wrapped in the root element encoded. It then calls the block with all un-encoded elements. # Selects all bold tags fr

ole_type

WIN32OLE_PARAM#ole_type Instance Public methods Returns OLE type of WIN32OLE_PARAM object(parameter of OLE method). tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') method = WIN32OLE_METHOD.new(tobj, 'SaveAs') param1 = method.params[0] puts param1.ole_type # => VARIANT

new

new(lib = nil, flags = Fiddle::RTLD_LAZY | Fiddle::RTLD_GLOBAL) Class Public methods Create a new handler that opens library named lib with flags. If no library is specified, RTLD_DEFAULT is used.

auth_tag

cipher.auth_tag([ tag_len ] â string Instance Public methods Gets the authentication tag generated by Authenticated Encryption Cipher modes (GCM for example). This tag may be stored along with the ciphertext, then set on the decryption cipher to authenticate the contents of the ciphertext against changes. If the optional integer parameter tag_len is given, the returned tag will be tag_len bytes long. If the parameter is omitted, the maximum length of 16 bytes will be returned. For

search_field

search_field(object_name, method, options = {}) Instance Public methods Returns an input of type âsearchâ for accessing a specified attribute (identified by method) on an object assigned to the template (identified by object_name). Inputs of type âsearchâ may be styled differently by some browsers. search_field(:user, :name) # => <input id="user_name" name="user[name]" type="search" /> search_field(:user, :name, autosave: false) # => <input autosave="false" id="user_