Invoked as a callback whenever a singleton method is added to the receiver.
module Chatty def Chatty.singleton_method_added(id) puts "Adding #{id.id2name}" end def self.one() end def two() end def Chatty.three() end end
produces:
Adding singleton_method_added Adding one Adding three
Like Enumerable#map
, but chains operation to be lazy-evaluated.
(1..Float::INFINITY).lazy.map {|i| i**2 } #=> #<Enumerator::Lazy: #<Enumerator::Lazy: 1..Infinity>:map> (1..Float::INFINITY).lazy.map {|i| i**2 }.first(3) #=> [1, 4, 9]
Like Enumerable#select
, but chains operation to be lazy-evaluated.
def redundant?: () -> bool
Returns the encoding of the source code, which is set by parameters to the parser or by the encoding magic comment.
Returns the encoding of the source code that was parsed.
Selects specified components from URI
.
require 'uri' uri = URI.parse('http://myuser:mypass@my.example.com/test.rbx') uri.select(:userinfo, :host, :path) # => ["myuser:mypass", "my.example.com", "/test.rbx"]
If a block is provided, returns a new array containing [key, value] pairs for which the block returns true.
Otherwise, same as values_at
Undo escaping such as that done by CGI.escapeElement()
print CGI.unescapeElement( CGI.escapeHTML('<BR><A HREF="url"></A>'), "A", "IMG") # "<BR><A HREF="url"></A>" print CGI.unescapeElement( CGI.escapeHTML('<BR><A HREF="url"></A>'), ["A", "IMG"]) # "<BR><A HREF="url"></A>"
Returns whether the form contained multipart/form-data
Create a new BackReferenceReadNode
node
Create a new ConstantAndWriteNode
node
Create a new ConstantOperatorWriteNode
node
Create a new ConstantOrWriteNode
node
Create a new ConstantPathAndWriteNode
node
Create a new ConstantPathNode
node
Create a new ConstantPathOperatorWriteNode
node
Create a new ConstantPathOrWriteNode
node
Create a new ConstantPathTargetNode
node
Create a new ConstantPathWriteNode
node