elementy 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ module Elementy
7
7
  File.dirname(File.dirname(__FILE__))
8
8
  end
9
9
 
10
- # Searches for and returns and element if found.
10
+ # Searches for and returns an element if found.
11
11
  #
12
12
  # @param term [string, symbol, integer] the name, symbol, or atomic
13
13
  # number to search for
@@ -19,9 +19,9 @@ module Elementy
19
19
 
20
20
  def search(term)
21
21
  if term.is_a?(Numeric) || term =~ /\A\d*\Z/
22
- find { |e| e.number == term.to_i}
22
+ find { |e| e.number == term.to_i }
23
23
  else
24
- find { |e| [e.symbol, e.name].any? { |a| a.upcase == term.to_s.upcase} }
24
+ find { |e| [e.symbol, e.name].map(&:upcase).include? term.to_s.upcase }
25
25
  end
26
26
  end
27
27
  end
@@ -1,3 +1,3 @@
1
1
  module Elementy
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elementy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: