eulim 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c8b8f74fecee6be4ff43f955f2961d853a431d6
4
- data.tar.gz: 9a1bd10d9e0ced130ed4a8d254c383cdd07082d4
3
+ metadata.gz: 70a2747acb9bbf40b846a25822ee983fad744ae6
4
+ data.tar.gz: baa67c3de9cb614adb5903792e6a612a98c5a051
5
5
  SHA512:
6
- metadata.gz: 7e81429659397209aa02602cbbffc8474d535e5dc8f94533dbaeaf8490ab290f25c5f22c79b36f8188babcbf4c8b2c3d1adf5a54fd1a501e81c702676dc70cd0
7
- data.tar.gz: 0abf3f59ee40438d1782ba31201bb8aaad6e4447b3a02421cff9577f9138033234c252c2752e3dcee3f18db81a11d0d32147524107db077ea2a235367cf1be45
6
+ metadata.gz: e53a41f23872abaa62b9e519a9a0509222195b4c985902f660bfb0b1adb93af5350cd016dd166fce9540bb60b727cdbd965f7d2ee7ccc5d33e50c8e0dfac5cd9
7
+ data.tar.gz: e1f00ce1f761ac0b778c0d159cb996e7d6f5bb3e08820b0103b5f6d272511a96a71fda4dfb9602c847c3eb853c6b9983171ac57546436571f5f94eb001aab064
data/README.md CHANGED
@@ -1,9 +1,5 @@
1
1
  # Eulim
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/eulim`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
3
  ## Installation
8
4
 
9
5
  Add this line to your application's Gemfile:
@@ -20,9 +16,32 @@ Or install it yourself as:
20
16
 
21
17
  $ gem install eulim
22
18
 
19
+ ## Modules
20
+
21
+ * Structrues
22
+ * Chemistry
23
+
24
+ ### Structures
25
+ * Pipe
26
+
27
+ ### Chemistry
28
+
29
+ * Element
30
+ * Compound
31
+
32
+ #### Element
33
+
34
+ * H, He, Li, Be, B, C, N, O, F, Ne, Na, Mg
35
+ * symbol, name, atomic_number, atomic_mass
36
+
23
37
  ## Usage
24
38
 
25
- TODO: Write usage instructions here
39
+ $ Eulim::Chemistry::Element.get_by_symbol("H")
40
+ => #<Eulim::Chemistry::Element:0x0055ac58c146e8 @symbol="Mg", @name="Magnesium", @atomic_number=12, @atomic_mass=24.305>
41
+
42
+ $ Eulim::Chemistry::Element.get_by_atomic_number(12)
43
+ => #<Eulim::Chemistry::Element:0x0055ac58c146e8 @symbol="Mg", @name="Magnesium", @atomic_number=12, @atomic_mass=24.305>
44
+
26
45
 
27
46
  ## Development
28
47
 
File without changes
@@ -0,0 +1,38 @@
1
+ module Eulim::Chemistry
2
+ class Element
3
+
4
+ @@elements = [
5
+ { symbol:'H', name: 'Hydrogen', atomic_number: 1, atomic_mass: 1.0079 },
6
+ { symbol:'He', name: 'Helium', atomic_number: 2, atomic_mass: 4.002602 },
7
+ { symbol:'Li', name: 'Lithium', atomic_number: 3, atomic_mass: 6.941 },
8
+ { symbol:'Be', name: 'Beryllium', atomic_number: 4, atomic_mass: 9.012182 },
9
+ { symbol:'B', name: 'Boron', atomic_number: 5, atomic_mass: 10.811 },
10
+ { symbol:'C', name: 'Carbon', atomic_number: 6, atomic_mass: 12.0107 },
11
+ { symbol:'N', name: 'Nitrogen', atomic_number: 7, atomic_mass: 14.0067 },
12
+ { symbol:'O', name: 'Oxygen', atomic_number: 8, atomic_mass: 15.9996 },
13
+ { symbol:'F', name: 'Fluorine', atomic_number: 9, atomic_mass: 18.9984 },
14
+ { symbol:'Ne', name: 'Neon', atomic_number: 10, atomic_mass: 20.1797 },
15
+ { symbol:'Na', name: 'Sodium', atomic_number: 11, atomic_mass: 22.9897 },
16
+ { symbol:'Mg', name: 'Magnesium', atomic_number: 12, atomic_mass: 24.305 }
17
+ ]
18
+
19
+ def initialize args
20
+ args.each do |k,v|
21
+ instance_variable_set("@#{k}", v) unless v.nil?
22
+ end
23
+ end
24
+
25
+ def self.all
26
+ @@elements
27
+ end
28
+
29
+ def self.get_by_symbol(symbol)
30
+ new(self.all.select { |element| element[:symbol] === symbol }.first)
31
+ end
32
+
33
+ def self.get_by_atomic_number(z)
34
+ new(self.all.select { |element| element[:atomic_number] === z }.first)
35
+ end
36
+
37
+ end
38
+ end
@@ -0,0 +1,2 @@
1
+ module Chemistry
2
+ end
data/lib/eulim/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eulim
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eulim
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Syed Fazil Basheer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-11 00:00:00.000000000 Z
11
+ date: 2017-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,6 +86,9 @@ files:
86
86
  - bin/setup
87
87
  - eulim.gemspec
88
88
  - lib/eulim.rb
89
+ - lib/eulim/chemistry.rb
90
+ - lib/eulim/chemistry/compound.rb
91
+ - lib/eulim/chemistry/element.rb
89
92
  - lib/eulim/structures.rb
90
93
  - lib/eulim/structures/pipe.rb
91
94
  - lib/eulim/structures/structure.rb