elementic 0.7 → 0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/elementic.rb +22 -17
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfea991222c69eb763824f2b776da50d49af93da
|
4
|
+
data.tar.gz: 6d0a18c227d764def065212cb12c70c4c9bd98bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 838a94e02370493a66c45d4970add05e65e2b8b67bfcee923396a5c7e408d30b5e2803916b5ba238e9c7457af67dde799c4b1c969d0b4842da290df193044cf2
|
7
|
+
data.tar.gz: d93b50716d064844ad4c030ce112728c3a5a59119c106580f3f19c6d93bc535f9abc58bb13df89871fe3564bdd3f2e51538de849fcb8664399b912f54176ef17
|
data/lib/elementic.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
VERSION = '0.
|
2
|
+
VERSION = '0.8'
|
3
3
|
|
4
4
|
$elements = {
|
5
5
|
'H' => 'Hydrogen',
|
@@ -161,23 +161,28 @@ end
|
|
161
161
|
# Use the element? method to convert
|
162
162
|
# all symbols into the element name
|
163
163
|
|
164
|
-
#
|
164
|
+
# Try to get this working
|
165
165
|
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
#
|
172
|
-
|
173
|
-
#
|
174
|
-
#
|
175
|
-
#
|
176
|
-
#
|
177
|
-
#
|
178
|
-
#
|
179
|
-
#
|
180
|
-
#
|
166
|
+
# **Not working yet:** You can also convert all of the
|
167
|
+
# symbols in a string to their actual name
|
168
|
+
# ```ruby
|
169
|
+
# 'Never put H in balloons'.convert_all # => 'Never put Hydrogen in balloons'
|
170
|
+
# 'K and As are not good to consume'.convert_all # => 'Potassium and Arsenic are not good to consume'
|
171
|
+
# ```
|
172
|
+
|
173
|
+
# def convert_all
|
174
|
+
# input = self.capitalize
|
175
|
+
# keys = $elements.keys
|
176
|
+
# if input.element?
|
177
|
+
# $new = input.split ' '
|
178
|
+
# keys.each do |k|
|
179
|
+
# if $new.include? k
|
180
|
+
# $new = $new.gsub(k, $elements[k])
|
181
|
+
# end
|
182
|
+
# end
|
183
|
+
# puts $new.join ' '
|
184
|
+
# end
|
185
|
+
# end
|
181
186
|
|
182
187
|
# Create some methods for the Elementic class
|
183
188
|
class Elementic
|