fixed typos
This commit is contained in:
parent
2aac5f6b39
commit
8e2e82ea58
2 changed files with 5 additions and 20 deletions
|
@ -1,15 +0,0 @@
|
||||||
---
|
|
||||||
layout: default
|
|
||||||
---
|
|
||||||
<div id="post">
|
|
||||||
{{ content }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="related">
|
|
||||||
<h2>Related Posts</h2>
|
|
||||||
<ul class="posts">
|
|
||||||
{% for post in site.related_posts limit:3 %}
|
|
||||||
<li><span>{{ post.date | date_to_string }}</span> » <a href="{{ post.url }}">{{ post.title }}</a></li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
layout: programming
|
layout: programming
|
||||||
title: "Ruby 2.6+ Array#Difference"
|
title: "ruby 2.6+ array#difference"
|
||||||
date: 2019-02-05
|
date: 2019-02-05
|
||||||
categories: programming
|
categories: programming
|
||||||
---
|
---
|
||||||
|
@ -17,7 +17,7 @@ A method to check differences in values between two arrays.
|
||||||
[1] pry(main)> abc = ['a','b','c']
|
[1] pry(main)> abc = ['a','b','c']
|
||||||
=> ["a", "b", "c"]
|
=> ["a", "b", "c"]
|
||||||
|
|
||||||
[2] pry(main)> abcdef = 'a', 'b', 'c', 'd', 'e', 'f'
|
[2] pry(main)> abcdef = ['a', 'b', 'c', 'd', 'e', 'f']
|
||||||
=> ["a", "b", "c", "d", "e", "f"]
|
=> ["a", "b", "c", "d", "e", "f"]
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ A method to check differences in values between two arrays.
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
|
||||||
#### ruby 2.5
|
#### Ruby 2.5
|
||||||
In versions prior, I would make a .difference method in my .pryrc file and that
|
In versions prior, I would make a .difference method in my .pryrc file and that
|
||||||
will be loaded at runtime when I run my console. You can also monkey patch it
|
will be loaded at runtime when I run my console. You can also monkey patch it
|
||||||
live in a pry console. Found this via
|
live in a pry console. Found this via
|
||||||
|
@ -49,7 +49,7 @@ post. Here is how I would add it in a running pry session:
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
|
||||||
#### ruby 2.6
|
#### Ruby 2.6
|
||||||
But now in ruby 2.6+, you can just use the .difference method. It is built into
|
But now in ruby 2.6+, you can just use the .difference method. It is built into
|
||||||
the class now.
|
the class now.
|
||||||
|
|
||||||
|
@ -58,4 +58,4 @@ the class now.
|
||||||
=> ["d", "e", "f"]
|
=> ["d", "e", "f"]
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
so nice, so easy!
|
So nice, so easy!
|
||||||
|
|
Loading…
Add table
Reference in a new issue