Sha256: 0dea57e86600cc69709cb9873c5fc723e1dcfd32fcdf6bec5d7f4ef603fe5ff0

Contents?: true

Size: 1.53 KB

Versions: 1

Compression:

Stored size: 1.53 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>build_regex_from_constant (APILookup)</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/lookup.rb, line 51</span>
    <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_regex_from_constant</span>(<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">parts</span>=<span class="ruby-identifier">name</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;::&quot;</span>).<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">c</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;&quot;</span>).<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;[^:]*&quot;</span>)<span class="ruby-operator">+</span><span class="ruby-value str">&quot;[^:]*&quot;</span>
      <span class="ruby-keyword kw">end</span>
      <span class="ruby-node">/#{parts.join(&quot;::&quot;)}/i</span>
    <span class="ruby-keyword kw">end</span></pre>
</body>
</html>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lookup-1.0.0.beta1 doc/classes/APILookup.src/M000006.html