File: C:/Ruby27-x64/share/doc/ruby/html/Gem/Resolver/DependencyRequest.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>class Gem::Resolver::DependencyRequest - RDoc Documentation</title>
<script type="text/javascript">
var rdoc_rel_prefix = "../../";
var index_rel_prefix = "../../";
</script>
<script src="../../js/navigation.js" defer></script>
<script src="../../js/search.js" defer></script>
<script src="../../js/search_index.js" defer></script>
<script src="../../js/searcher.js" defer></script>
<script src="../../js/darkfish.js" defer></script>
<link href="../../css/fonts.css" rel="stylesheet">
<link href="../../css/rdoc.css" rel="stylesheet">
<body id="top" role="document" class="class">
<nav role="navigation">
<div id="project-navigation">
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
<h2>
<a href="../../index.html" rel="home">Home</a>
</h2>
<div id="table-of-contents-navigation">
<a href="../../table_of_contents.html#pages">Pages</a>
<a href="../../table_of_contents.html#classes">Classes</a>
<a href="../../table_of_contents.html#methods">Methods</a>
</div>
</div>
<div id="search-section" role="search" class="project-section initially-hidden">
<form action="#" method="get" accept-charset="utf-8">
<div id="search-field-wrapper">
<input id="search-field" role="combobox" aria-label="Search"
aria-autocomplete="list" aria-controls="search-results"
type="text" name="search" placeholder="Search" spellcheck="false"
title="Type to search, Up and Down to navigate, Enter to load">
</div>
<ul id="search-results" aria-label="Search Results"
aria-busy="false" aria-expanded="false"
aria-atomic="false" class="initially-hidden"></ul>
</form>
</div>
</div>
<div id="class-metadata">
<div id="parent-class-section" class="nav-section">
<h3>Parent</h3>
<p class="link"><a href="../../Object.html">Object</a>
</div>
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
<h3>Methods</h3>
<ul class="link-list" role="directory">
<li ><a href="#method-c-new">::new</a>
<li ><a href="#method-i-development-3F">#development?</a>
<li ><a href="#method-i-explicit-3F">#explicit?</a>
<li ><a href="#method-i-implicit-3F">#implicit?</a>
<li ><a href="#method-i-match-3F">#match?</a>
<li ><a href="#method-i-matches_spec-3F">#matches_spec?</a>
<li ><a href="#method-i-name">#name</a>
<li ><a href="#method-i-request_context">#request_context</a>
<li ><a href="#method-i-requirement">#requirement</a>
<li ><a href="#method-i-type">#type</a>
</ul>
</div>
</div>
</nav>
<main role="main" aria-labelledby="class-Gem::Resolver::DependencyRequest">
<h1 id="class-Gem::Resolver::DependencyRequest" class="class">
class Gem::Resolver::DependencyRequest
</h1>
<section class="description">
<p>Used Internally. Wraps a Dependency object to also track which spec contained the Dependency.</p>
</section>
<section id="5Buntitled-5D" class="documentation-section">
<section class="attribute-method-details" class="method-section">
<header>
<h3>Attributes</h3>
</header>
<div id="attribute-i-dependency" class="method-detail">
<div class="method-heading attribute-method-heading">
<span class="method-name">dependency</span><span
class="attribute-access-type">[R]</span>
</div>
<div class="method-description">
<p>The wrapped <a href="../Dependency.html"><code>Gem::Dependency</code></a></p>
</div>
</div>
<div id="attribute-i-requester" class="method-detail">
<div class="method-heading attribute-method-heading">
<span class="method-name">requester</span><span
class="attribute-access-type">[R]</span>
</div>
<div class="method-description">
<p>The request for this dependency.</p>
</div>
</div>
</section>
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
<header>
<h3>Public Class Methods</h3>
</header>
<div id="method-c-new" class="method-detail ">
<div class="method-heading">
<span class="method-name">new</span><span
class="method-args">(dependency, requester)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Creates a new <a href="DependencyRequest.html"><code>DependencyRequest</code></a> for <code>dependency</code> from <code>requester</code>. +requester may be nil if the request came from a user.</p>
<div class="method-source-code" id="new-source">
<pre><span class="ruby-comment"># File lib/rubygems/resolver/dependency_request.rb, line 22</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">dependency</span>, <span class="ruby-identifier">requester</span>)
<span class="ruby-ivar">@dependency</span> = <span class="ruby-identifier">dependency</span>
<span class="ruby-ivar">@requester</span> = <span class="ruby-identifier">requester</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
</section>
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
<header>
<h3>Public Instance Methods</h3>
</header>
<div id="method-i-development-3F" class="method-detail ">
<div class="method-heading">
<span class="method-name">development?</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Is this dependency a development dependency?</p>
<div class="method-source-code" id="development-3F-source">
<pre><span class="ruby-comment"># File lib/rubygems/resolver/dependency_request.rb, line 41</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">development?</span>
<span class="ruby-ivar">@dependency</span>.<span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:development</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div id="method-i-explicit-3F" class="method-detail ">
<div class="method-heading">
<span class="method-name">explicit?</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Indicate that the request is for a gem explicitly requested by the user</p>
<div class="method-source-code" id="explicit-3F-source">
<pre><span class="ruby-comment"># File lib/rubygems/resolver/dependency_request.rb, line 78</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">explicit?</span>
<span class="ruby-ivar">@requester</span>.<span class="ruby-identifier">nil?</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div id="method-i-implicit-3F" class="method-detail ">
<div class="method-heading">
<span class="method-name">implicit?</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Indicate that the request is for a gem requested as a dependency of another gem</p>
<div class="method-source-code" id="implicit-3F-source">
<pre><span class="ruby-comment"># File lib/rubygems/resolver/dependency_request.rb, line 86</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">implicit?</span>
<span class="ruby-operator">!</span><span class="ruby-identifier">explicit?</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div id="method-i-match-3F" class="method-detail ">
<div class="method-heading">
<span class="method-name">match?</span><span
class="method-args">(spec, allow_prerelease = false)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Does this dependency request match <code>spec</code>?</p>
<p>NOTE: <a href="DependencyRequest.html#method-i-match-3F"><code>match?</code></a> only matches prerelease versions when <a href="DependencyRequest.html#attribute-i-dependency"><code>dependency</code></a> is a prerelease dependency.</p>
<div class="method-source-code" id="match-3F-source">
<pre><span class="ruby-comment"># File lib/rubygems/resolver/dependency_request.rb, line 51</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">match?</span>(<span class="ruby-identifier">spec</span>, <span class="ruby-identifier">allow_prerelease</span> = <span class="ruby-keyword">false</span>)
<span class="ruby-ivar">@dependency</span>.<span class="ruby-identifier">match?</span> <span class="ruby-identifier">spec</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">allow_prerelease</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div id="method-i-matches_spec-3F" class="method-detail ">
<div class="method-heading">
<span class="method-name">matches_spec?</span><span
class="method-args">(spec)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Does this dependency request match <code>spec</code>?</p>
<p>NOTE: <a href="DependencyRequest.html#method-i-matches_spec-3F"><code>matches_spec?</code></a> matches prerelease versions. See also <a href="DependencyRequest.html#method-i-match-3F"><code>match?</code></a></p>
<div class="method-source-code" id="matches_spec-3F-source">
<pre><span class="ruby-comment"># File lib/rubygems/resolver/dependency_request.rb, line 60</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">matches_spec?</span>(<span class="ruby-identifier">spec</span>)
<span class="ruby-ivar">@dependency</span>.<span class="ruby-identifier">matches_spec?</span> <span class="ruby-identifier">spec</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div id="method-i-name" class="method-detail ">
<div class="method-heading">
<span class="method-name">name</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>The name of the gem this dependency request is requesting.</p>
<div class="method-source-code" id="name-source">
<pre><span class="ruby-comment"># File lib/rubygems/resolver/dependency_request.rb, line 67</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">name</span>
<span class="ruby-ivar">@dependency</span>.<span class="ruby-identifier">name</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div id="method-i-request_context" class="method-detail ">
<div class="method-heading">
<span class="method-name">request_context</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Return a <a href="../../String.html"><code>String</code></a> indicating who caused this request to be added (only valid for implicit requests)</p>
<div class="method-source-code" id="request_context-source">
<pre><span class="ruby-comment"># File lib/rubygems/resolver/dependency_request.rb, line 94</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">request_context</span>
<span class="ruby-ivar">@requester</span> <span class="ruby-operator">?</span> <span class="ruby-ivar">@requester</span>.<span class="ruby-identifier">request</span> <span class="ruby-operator">:</span> <span class="ruby-string">"(unknown)"</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div id="method-i-requirement" class="method-detail ">
<div class="method-heading">
<span class="method-name">requirement</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>The version requirement for this dependency request</p>
<div class="method-source-code" id="requirement-source">
<pre><span class="ruby-comment"># File lib/rubygems/resolver/dependency_request.rb, line 112</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">requirement</span>
<span class="ruby-ivar">@dependency</span>.<span class="ruby-identifier">requirement</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div id="method-i-type" class="method-detail ">
<div class="method-heading">
<span class="method-name">type</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="type-source">
<pre><span class="ruby-comment"># File lib/rubygems/resolver/dependency_request.rb, line 71</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">type</span>
<span class="ruby-ivar">@dependency</span>.<span class="ruby-identifier">type</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
</section>
</section>
</main>
<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.1.1.
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>