Sha256: cca7c3229a91700d6d166056b0839891ef76eb480eee47cbe79ae12e043a9b6b
Contents?: true
Size: 1.92 KB
Versions: 3
Compression:
Stored size: 1.92 KB
Contents
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>hash_reader (HashAttrs)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> <pre><span class="ruby-comment cmt"># File lib/hash_attrs.rb, line 4</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash_reader</span>(<span class="ruby-identifier">hash_sym</span>, <span class="ruby-identifier">syms</span>) <span class="ruby-identifier">syms</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">id</span><span class="ruby-operator">|</span> <span class="ruby-identifier">id</span> = <span class="ruby-identifier">id</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-identifier">func</span> = <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-identifier">hash</span> = <span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">hash_sym</span>) <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">id</span>.<span class="ruby-identifier">to_sym</span>] <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:define_method</span>, <span class="ruby-identifier">id</span>, <span class="ruby-identifier">func</span>) <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">end</span></pre> </body> </html>
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
icalendar-0.97 | docs/api/classes/HashAttrs.src/M000068.html |
icalendar-0.98 | docs/api/classes/HashAttrs.src/M000068.html |
icalendar-1.0 | docs/api/classes/HashAttrs.src/M000070.html |