elementy 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/elementy.rb +1 -1
- data/lib/elementy/element.rb +2 -2
- data/lib/elementy/version.rb +1 -1
- metadata +1 -1
data/lib/elementy.rb
CHANGED
@@ -7,7 +7,7 @@ module Elementy
|
|
7
7
|
File.dirname(File.dirname(__FILE__))
|
8
8
|
end
|
9
9
|
|
10
|
-
# Searches for and returns
|
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
|
data/lib/elementy/element.rb
CHANGED
@@ -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].
|
24
|
+
find { |e| [e.symbol, e.name].map(&:upcase).include? term.to_s.upcase }
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
data/lib/elementy/version.rb
CHANGED