sass-site/source/documentation/Sass/Media/Query.html

1335 lines
48 KiB
HTML
Raw Normal View History

2018-10-22 23:13:05 +02:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Class: Sass::Media::Query
&mdash; Documentation by YARD 0.9.12
</title>
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="../../../assets/css/docs.css" type="text/css" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
hasFrames = window.top.frames.main ? true : false;
relpath = '../../';
framesUrl = "../../frames.html#!Sass/Media/Query.html";
</script>
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
</head>
<body>
<div id="header">
<div id="menu">
<a href="../../_index.html">Index (Q)</a> &raquo;
<span class='title'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Media.html" title="Sass::Media (module)">Media</a></span></span>
&raquo;
<span class="title">Query</span>
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="../../class_list.html">
Class List
</a>
<a class="full_list_link" id="method_list_link"
href="../../method_list.html">
Method List
</a>
<a class="full_list_link" id="file_list_link"
href="../../file_list.html">
File List
</a>
</div>
<div class="clear"></div>
</div>
<iframe id="search_frame"></iframe>
<div id="content"><h1>Class: Sass::Media::Query
</h1>
<dl class="box">
<dt class="r1">Inherits:</dt>
<dd class="r1">
<span class="inheritName">Object</span>
<ul class="fullTree">
<li>Object</li>
<li class="next">Sass::Media::Query</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
<dt class="r2 last">Defined in:</dt>
<dd class="r2 last">.ruby-sass/lib/sass/media.rb</dd>
</dl>
<div class="clear"></div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>A single media query.</p>
<pre class="code ruby"><code class="ruby">[ [ONLY | NOT]? S* media_type S* | expression ] [ AND S* expression ]*
</code></pre>
</div>
</div>
<div class="tags">
</div>
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#expressions-instance_method" title="#expressions (instance method)">#<strong>expressions</strong> &#x21d2; Array&lt;Array&lt;String, Sass::Script::Tree::Node&gt;&gt; </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>The trailing expressions in the query.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#modifier-instance_method" title="#modifier (instance method)">#<strong>modifier</strong> &#x21d2; Array&lt;String, Sass::Script::Tree::Node&gt; </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>The modifier for the query.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#type-instance_method" title="#type (instance method)">#<strong>type</strong> &#x21d2; Array&lt;String, Sass::Script::Tree::Node&gt; </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>The type of the query (e.g. `“screen”` or `“print”`).</p>
</div></span>
</li>
</ul>
<h2>
Instance Method Summary
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#deep_copy-instance_method" title="#deep_copy (instance method)">#<strong>deep_copy</strong> &#x21d2; Query </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns a deep copy of this query and all its children.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(modifier, type, expressions) &#x21d2; Query </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of Query.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#merge-instance_method" title="#merge (instance method)">#<strong>merge</strong>(other) &#x21d2; Query? </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Merges this query with another.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#resolved_modifier-instance_method" title="#resolved_modifier (instance method)">#<strong>resolved_modifier</strong> &#x21d2; String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>See <span class='object_link'><a href="#modifier-instance_method" title="Sass::Media::Query#modifier (method)">#modifier</a></span>.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#resolved_type-instance_method" title="#resolved_type (instance method)">#<strong>resolved_type</strong> &#x21d2; String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>See <span class='object_link'><a href="#type-instance_method" title="Sass::Media::Query#type (method)">#type</a></span>.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#to_a-instance_method" title="#to_a (instance method)">#<strong>to_a</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#to_css-instance_method" title="#to_css (instance method)">#<strong>to_css</strong> &#x21d2; String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the CSS for the media query.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#to_src-instance_method" title="#to_src (instance method)">#<strong>to_src</strong>(options) &#x21d2; String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the Sass/SCSS code for the media query.</p>
</div></span>
</li>
</ul>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<div class="method_details first">
<h3 class="signature first" id="initialize-instance_method">
#<strong>initialize</strong>(modifier, type, expressions) &#x21d2; <tt><span class='object_link'><a href="" title="Sass::Media::Query (class)">Query</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of Query</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>modifier</span>
<span class='type'>(<tt>Array&lt;String, <span class='object_link'><a href="../Script/Tree/Node.html" title="Sass::Script::Tree::Node (class)">Sass::Script::Tree::Node</a></span>&gt;</tt>)</span>
&mdash;
<div class='inline'>
<p>See <span class='object_link'><a href="#modifier-instance_method" title="Sass::Media::Query#modifier (method)">#modifier</a></span></p>
</div>
</li>
<li>
<span class='name'>type</span>
<span class='type'>(<tt>Array&lt;String, <span class='object_link'><a href="../Script/Tree/Node.html" title="Sass::Script::Tree::Node (class)">Sass::Script::Tree::Node</a></span>&gt;</tt>)</span>
&mdash;
<div class='inline'>
<p>See <span class='object_link'><a href="#type-instance_method" title="Sass::Media::Query#type (method)">#type</a></span></p>
</div>
</li>
<li>
<span class='name'>expressions</span>
<span class='type'>(<tt>Array&lt;Array&lt;String, <span class='object_link'><a href="../Script/Tree/Node.html" title="Sass::Script::Tree::Node (class)">Sass::Script::Tree::Node</a></span>&gt;&gt;</tt>)</span>
&mdash;
<div class='inline'>
<p>See <span class='object_link'><a href="#expressions-instance_method" title="Sass::Media::Query#expressions (method)">#expressions</a></span></p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
96
97
98
99
100</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/media.rb', line 96</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_modifier'>modifier</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_expressions'>expressions</span><span class='rparen'>)</span>
<span class='ivar'>@modifier</span> <span class='op'>=</span> <span class='id identifier rubyid_modifier'>modifier</span>
<span class='ivar'>@type</span> <span class='op'>=</span> <span class='id identifier rubyid_type'>type</span>
<span class='ivar'>@expressions</span> <span class='op'>=</span> <span class='id identifier rubyid_expressions'>expressions</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<div class="method_details first">
<h3 class="signature first" id="initialize-instance_method">
#<strong>initialize</strong>(modifier, type, expressions) &#x21d2; <tt><span class='object_link'><a href="" title="Sass::Media::Query (class)">Query</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of Query</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>modifier</span>
<span class='type'>(<tt>Array&lt;String, <span class='object_link'><a href="../Script/Tree/Node.html" title="Sass::Script::Tree::Node (class)">Sass::Script::Tree::Node</a></span>&gt;</tt>)</span>
&mdash;
<div class='inline'>
<p>See <span class='object_link'><a href="#modifier-instance_method" title="Sass::Media::Query#modifier (method)">#modifier</a></span></p>
</div>
</li>
<li>
<span class='name'>type</span>
<span class='type'>(<tt>Array&lt;String, <span class='object_link'><a href="../Script/Tree/Node.html" title="Sass::Script::Tree::Node (class)">Sass::Script::Tree::Node</a></span>&gt;</tt>)</span>
&mdash;
<div class='inline'>
<p>See <span class='object_link'><a href="#type-instance_method" title="Sass::Media::Query#type (method)">#type</a></span></p>
</div>
</li>
<li>
<span class='name'>expressions</span>
<span class='type'>(<tt>Array&lt;Array&lt;String, <span class='object_link'><a href="../Script/Tree/Node.html" title="Sass::Script::Tree::Node (class)">Sass::Script::Tree::Node</a></span>&gt;&gt;</tt>)</span>
&mdash;
<div class='inline'>
<p>See <span class='object_link'><a href="#expressions-instance_method" title="Sass::Media::Query#expressions (method)">#expressions</a></span></p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
96
97
98
99
100</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/media.rb', line 96</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_modifier'>modifier</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_expressions'>expressions</span><span class='rparen'>)</span>
<span class='ivar'>@modifier</span> <span class='op'>=</span> <span class='id identifier rubyid_modifier'>modifier</span>
<span class='ivar'>@type</span> <span class='op'>=</span> <span class='id identifier rubyid_type'>type</span>
<span class='ivar'>@expressions</span> <span class='op'>=</span> <span class='id identifier rubyid_expressions'>expressions</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_attr_details" class="attr_details">
<h2>Instance Attribute Details</h2>
<span id="expressions=-instance_method"></span>
<div class="method_details first">
<h3 class="signature first" id="expressions-instance_method">
#<strong>expressions</strong> &#x21d2; <tt>Array&lt;Array&lt;String, <span class='object_link'><a href="../Script/Tree/Node.html" title="Sass::Script::Tree::Node (class)">Sass::Script::Tree::Node</a></span>&gt;&gt;</tt>
</h3><div class="docstring">
<div class="discussion">
<p>The trailing expressions in the query.</p>
<p>When parsed as Sass code, each expression contains strings and SassScript
nodes. When parsed as CSS, each one contains a single string.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Array&lt;Array&lt;String, <span class='object_link'><a href="../Script/Tree/Node.html" title="Sass::Script::Tree::Node (class)">Sass::Script::Tree::Node</a></span>&gt;&gt;</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
91
92
93</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/media.rb', line 91</span>
<span class='kw'>def</span> <span class='id identifier rubyid_expressions'>expressions</span>
<span class='ivar'>@expressions</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="modifier=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="modifier-instance_method">
#<strong>modifier</strong> &#x21d2; <tt>Array&lt;String, <span class='object_link'><a href="../Script/Tree/Node.html" title="Sass::Script::Tree::Node (class)">Sass::Script::Tree::Node</a></span>&gt;</tt>
</h3><div class="docstring">
<div class="discussion">
<p>The modifier for the query.</p>
<p>When parsed as Sass code, this contains strings and SassScript nodes. When
parsed as CSS, it contains a single string (accessible via
<span class='object_link'><a href="#resolved_modifier-instance_method" title="Sass::Media::Query#resolved_modifier (method)">#resolved_modifier</a></span>).</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Array&lt;String, <span class='object_link'><a href="../Script/Tree/Node.html" title="Sass::Script::Tree::Node (class)">Sass::Script::Tree::Node</a></span>&gt;</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
74
75
76</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/media.rb', line 74</span>
<span class='kw'>def</span> <span class='id identifier rubyid_modifier'>modifier</span>
<span class='ivar'>@modifier</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="type=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="type-instance_method">
#<strong>type</strong> &#x21d2; <tt>Array&lt;String, <span class='object_link'><a href="../Script/Tree/Node.html" title="Sass::Script::Tree::Node (class)">Sass::Script::Tree::Node</a></span>&gt;</tt>
</h3><div class="docstring">
<div class="discussion">
<p>The type of the query (e.g. `“screen”` or `“print”`).</p>
<p>When parsed as Sass code, this contains strings and SassScript nodes. When
parsed as CSS, it contains a single string (accessible via
<span class='object_link'><a href="#resolved_type-instance_method" title="Sass::Media::Query#resolved_type (method)">#resolved_type</a></span>).</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Array&lt;String, <span class='object_link'><a href="../Script/Tree/Node.html" title="Sass::Script::Tree::Node (class)">Sass::Script::Tree::Node</a></span>&gt;</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
83
84
85</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/media.rb', line 83</span>
<span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
<span class='ivar'>@type</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="deep_copy-instance_method">
#<strong>deep_copy</strong> &#x21d2; <tt><span class='object_link'><a href="" title="Sass::Media::Query (class)">Query</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a deep copy of this query and all its children.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="" title="Sass::Media::Query (class)">Query</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
194
195
196
197
198
199</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/media.rb', line 194</span>
<span class='kw'>def</span> <span class='id identifier rubyid_deep_copy'>deep_copy</span>
<span class='const'><span class='object_link'><a href="" title="Sass::Media::Query (class)">Query</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Sass::Media::Query#initialize (method)">new</a></span></span><span class='lparen'>(</span>
<span class='id identifier rubyid_modifier'>modifier</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Script.html" title="Sass::Script (module)">Script</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Script/Tree.html" title="Sass::Script::Tree (module)">Tree</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Script/Tree/Node.html" title="Sass::Script::Tree::Node (class)">Node</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_deep_copy'>deep_copy</span> <span class='op'>:</span> <span class='id identifier rubyid_c'>c</span><span class='rbrace'>}</span><span class='comma'>,</span>
<span class='id identifier rubyid_type'>type</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Script.html" title="Sass::Script (module)">Script</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Script/Tree.html" title="Sass::Script::Tree (module)">Tree</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Script/Tree/Node.html" title="Sass::Script::Tree::Node (class)">Node</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_deep_copy'>deep_copy</span> <span class='op'>:</span> <span class='id identifier rubyid_c'>c</span><span class='rbrace'>}</span><span class='comma'>,</span>
<span class='id identifier rubyid_expressions'>expressions</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Script.html" title="Sass::Script (module)">Script</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Script/Tree.html" title="Sass::Script::Tree (module)">Tree</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Script/Tree/Node.html" title="Sass::Script::Tree::Node (class)">Node</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_deep_copy'>deep_copy</span> <span class='op'>:</span> <span class='id identifier rubyid_c'>c</span><span class='rbrace'>}</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="merge-instance_method">
#<strong>merge</strong>(other) &#x21d2; <tt><span class='object_link'><a href="" title="Sass::Media::Query (class)">Query</a></span>?</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Merges this query with another. The returned query queries for the
intersection between the two inputs.</p>
<p>Both queries should be resolved.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>other</span>
<span class='type'>(<tt><span class='object_link'><a href="" title="Sass::Media::Query (class)">Query</a></span></tt>)</span>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="" title="Sass::Media::Query (class)">Query</a></span>?</tt>)</span>
&mdash;
<div class='inline'>
<p>The merged query, or nil if there is no intersection.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/media.rb', line 123</span>
<span class='kw'>def</span> <span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
<span class='id identifier rubyid_m1'>m1</span><span class='comma'>,</span> <span class='id identifier rubyid_t1'>t1</span> <span class='op'>=</span> <span class='id identifier rubyid_resolved_modifier'>resolved_modifier</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='comma'>,</span> <span class='id identifier rubyid_resolved_type'>resolved_type</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span>
<span class='id identifier rubyid_m2'>m2</span><span class='comma'>,</span> <span class='id identifier rubyid_t2'>t2</span> <span class='op'>=</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_resolved_modifier'>resolved_modifier</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='comma'>,</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_resolved_type'>resolved_type</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span>
<span class='id identifier rubyid_t1'>t1</span> <span class='op'>=</span> <span class='id identifier rubyid_t2'>t2</span> <span class='kw'>if</span> <span class='id identifier rubyid_t1'>t1</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='id identifier rubyid_t2'>t2</span> <span class='op'>=</span> <span class='id identifier rubyid_t1'>t1</span> <span class='kw'>if</span> <span class='id identifier rubyid_t2'>t2</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_m1'>m1</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>not</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='op'>^</span> <span class='lparen'>(</span><span class='id identifier rubyid_m2'>m2</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>not</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_t1'>t1</span> <span class='op'>==</span> <span class='id identifier rubyid_t2'>t2</span>
<span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='id identifier rubyid_m1'>m1</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>not</span><span class='tstring_end'>&#39;</span></span> <span class='op'>?</span> <span class='id identifier rubyid_t2'>t2</span> <span class='op'>:</span> <span class='id identifier rubyid_t1'>t1</span>
<span class='id identifier rubyid_mod'>mod</span> <span class='op'>=</span> <span class='id identifier rubyid_m1'>m1</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>not</span><span class='tstring_end'>&#39;</span></span> <span class='op'>?</span> <span class='id identifier rubyid_m2'>m2</span> <span class='op'>:</span> <span class='id identifier rubyid_m1'>m1</span>
<span class='kw'>elsif</span> <span class='id identifier rubyid_m1'>m1</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>not</span><span class='tstring_end'>&#39;</span></span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_m2'>m2</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>not</span><span class='tstring_end'>&#39;</span></span>
<span class='comment'># CSS has no way of representing &quot;neither screen nor print&quot;
</span> <span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_t1'>t1</span> <span class='op'>==</span> <span class='id identifier rubyid_t2'>t2</span>
<span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='id identifier rubyid_t1'>t1</span>
<span class='id identifier rubyid_mod'>mod</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>not</span><span class='tstring_end'>&#39;</span></span>
<span class='kw'>elsif</span> <span class='id identifier rubyid_t1'>t1</span> <span class='op'>!=</span> <span class='id identifier rubyid_t2'>t2</span>
<span class='kw'>return</span>
<span class='kw'>else</span> <span class='comment'># t1 == t2, neither m1 nor m2 are &quot;not&quot;
</span> <span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='id identifier rubyid_t1'>t1</span>
<span class='id identifier rubyid_mod'>mod</span> <span class='op'>=</span> <span class='id identifier rubyid_m1'>m1</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='id identifier rubyid_m2'>m2</span> <span class='op'>:</span> <span class='id identifier rubyid_m1'>m1</span>
<span class='kw'>end</span>
<span class='const'><span class='object_link'><a href="" title="Sass::Media::Query (class)">Query</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Sass::Media::Query#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_mod'>mod</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='id identifier rubyid_type'>type</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_expressions'>expressions</span> <span class='op'>+</span> <span class='id identifier rubyid_expressions'>expressions</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="resolved_modifier-instance_method">
#<strong>resolved_modifier</strong> &#x21d2; <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>See <span class='object_link'><a href="#modifier-instance_method" title="Sass::Media::Query#modifier (method)">#modifier</a></span>.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
104
105
106
107</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/media.rb', line 104</span>
<span class='kw'>def</span> <span class='id identifier rubyid_resolved_modifier'>resolved_modifier</span>
<span class='comment'># modifier should contain only a single string
</span> <span class='id identifier rubyid_modifier'>modifier</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="resolved_type-instance_method">
#<strong>resolved_type</strong> &#x21d2; <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>See <span class='object_link'><a href="#type-instance_method" title="Sass::Media::Query#type (method)">#type</a></span>.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
111
112
113
114</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/media.rb', line 111</span>
<span class='kw'>def</span> <span class='id identifier rubyid_resolved_type'>resolved_type</span>
<span class='comment'># type should contain only a single string
</span> <span class='id identifier rubyid_type'>type</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="to_a-instance_method">
#<strong>to_a</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">See Also:</p>
<ul class="see">
<li>Sass::Media::Query.\{MediaQuery\{MediaQuery#to\_a}</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
181
182
183
184
185
186
187
188
189</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/media.rb', line 181</span>
<span class='kw'>def</span> <span class='id identifier rubyid_to_a'>to_a</span>
<span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_res'>res</span> <span class='op'>+=</span> <span class='id identifier rubyid_modifier'>modifier</span>
<span class='id identifier rubyid_res'>res</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'> </span><span class='tstring_end'>&#39;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_modifier'>modifier</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='id identifier rubyid_res'>res</span> <span class='op'>+=</span> <span class='id identifier rubyid_type'>type</span>
<span class='id identifier rubyid_res'>res</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'> and </span><span class='tstring_end'>&#39;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_type'>type</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>||</span> <span class='id identifier rubyid_expressions'>expressions</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='id identifier rubyid_res'>res</span> <span class='op'>+=</span> <span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Util.html" title="Sass::Util (module)">Util</a></span></span><span class='period'>.</span><span class='id identifier rubyid_intersperse'><span class='object_link'><a href="../Util.html#intersperse-instance_method" title="Sass::Util#intersperse (method)">intersperse</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_expressions'>expressions</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'> and </span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
<span class='id identifier rubyid_res'>res</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="to_css-instance_method">
#<strong>to_css</strong> &#x21d2; <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the CSS for the media query.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
149
150
151
152
153
154
155
156
157
158
159
160
161
162</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/media.rb', line 149</span>
<span class='kw'>def</span> <span class='id identifier rubyid_to_css'>to_css</span>
<span class='id identifier rubyid_css'>css</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span>
<span class='id identifier rubyid_css'>css</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_resolved_modifier'>resolved_modifier</span>
<span class='id identifier rubyid_css'>css</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'> </span><span class='tstring_end'>&#39;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_resolved_modifier'>resolved_modifier</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='id identifier rubyid_css'>css</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_resolved_type'>resolved_type</span>
<span class='id identifier rubyid_css'>css</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'> and </span><span class='tstring_end'>&#39;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_resolved_type'>resolved_type</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>||</span> <span class='id identifier rubyid_expressions'>expressions</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='id identifier rubyid_css'>css</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_expressions'>expressions</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span>
<span class='comment'># It&#39;s possible for there to be script nodes in Expressions even when
</span> <span class='comment'># we&#39;re converting to CSS in the case where we parsed the document as
</span> <span class='comment'># CSS originally (as in css_test.rb).
</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Script.html" title="Sass::Script (module)">Script</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Script/Tree.html" title="Sass::Script::Tree (module)">Tree</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Script/Tree/Node.html" title="Sass::Script::Tree::Node (class)">Node</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_to_sass'>to_sass</span> <span class='op'>:</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
<span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'> and </span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_css'>css</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="to_src-instance_method">
#<strong>to_src</strong>(options) &#x21d2; <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the Sass/SCSS code for the media query.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>options</span>
<span class='type'>(<tt>{Symbol =&gt; Object}</tt>)</span>
&mdash;
<div class='inline'>
<p>An options hash (see <span class='object_link'><a href="../CSS.html#initialize-instance_method" title="Sass::CSS#initialize (method)">CSS#initialize</a></span>).</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
168
169
170
171
172
173
174
175
176
177
178</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/media.rb', line 168</span>
<span class='kw'>def</span> <span class='id identifier rubyid_to_src'>to_src</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
<span class='id identifier rubyid_src'>src</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span>
<span class='id identifier rubyid_src'>src</span> <span class='op'>&lt;&lt;</span> <span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Media.html" title="Sass::Media (module)">Media</a></span></span><span class='period'>.</span><span class='id identifier rubyid__interp_to_src'><span class='object_link'><a href="../Media.html#_interp_to_src-class_method" title="Sass::Media._interp_to_src (method)">_interp_to_src</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_modifier'>modifier</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
<span class='id identifier rubyid_src'>src</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'> </span><span class='tstring_end'>&#39;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_modifier'>modifier</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='id identifier rubyid_src'>src</span> <span class='op'>&lt;&lt;</span> <span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Media.html" title="Sass::Media (module)">Media</a></span></span><span class='period'>.</span><span class='id identifier rubyid__interp_to_src'><span class='object_link'><a href="../Media.html#_interp_to_src-class_method" title="Sass::Media._interp_to_src (method)">_interp_to_src</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
<span class='id identifier rubyid_src'>src</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'> and </span><span class='tstring_end'>&#39;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_type'>type</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>||</span> <span class='id identifier rubyid_expressions'>expressions</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='id identifier rubyid_src'>src</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_expressions'>expressions</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span>
<span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Media.html" title="Sass::Media (module)">Media</a></span></span><span class='period'>.</span><span class='id identifier rubyid__interp_to_src'><span class='object_link'><a href="../Media.html#_interp_to_src-class_method" title="Sass::Media._interp_to_src (method)">_interp_to_src</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
<span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'> and </span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_src'>src</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Oct 22 13:20:52 2018 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.12 (ruby-2.5.3).
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-535380-14', 'sass-lang.com');
ga('send', 'pageview');
</script>
</body>
</html>