ms-core 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.6
1
+ 0.0.7
data/lib/cv/cv.rb ADDED
@@ -0,0 +1,3 @@
1
+
2
+ require 'cv/description'
3
+ require 'cv/param'
@@ -0,0 +1,8 @@
1
+
2
+ module Cv
3
+ class Description < Array
4
+ def to_xml(xml)
5
+ each {|param| param.to_xml(xml) }
6
+ end
7
+ end
8
+ end
data/lib/cv/param.rb ADDED
@@ -0,0 +1,17 @@
1
+
2
+ module Cv
3
+ class Param
4
+ attr_accessor :cv_ref, :accession, :name, :value
5
+
6
+ def initialize(cv_ref, accession, name, value=nil)
7
+ (@cv_ref, @accession, @name, @value) = [cv_ref, accession, name, value]
8
+ end
9
+
10
+ def to_xml(xml, name=:cvParam)
11
+ hash_to_send = {:cvRef => @cvref, :accession => @accession, :name => @name}
12
+ hash_to_send[:value] = @value if @value
13
+ xml.send(name, hash_to_send)
14
+ end
15
+ end
16
+ end
17
+
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 6
9
- version: 0.0.6
8
+ - 7
9
+ version: 0.0.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Simon Chiang
@@ -60,7 +60,9 @@ files:
60
60
  - README.rdoc
61
61
  - Rakefile
62
62
  - VERSION
63
- - lib/cv_param.rb
63
+ - lib/cv/cv.rb
64
+ - lib/cv/description.rb
65
+ - lib/cv/param.rb
64
66
  - lib/ms.rb
65
67
  - lib/ms/calc.rb
66
68
  - lib/ms/data.rb
data/lib/cv_param.rb DELETED
@@ -1,16 +0,0 @@
1
-
2
- # Controlled vocabulary
3
- class CvParam
4
- attr_accessor :cv_ref, :accession, :name, :value
5
-
6
- def initialize(cv_ref, accession, name, value=nil)
7
- (@cv_ref, @accession, @name, @value) = [cv_ref, accession, name, value]
8
- end
9
-
10
- def to_xml(xml, name=:cvParam)
11
- hash_to_send = {:cvRef => @cvref, :accession => @accession, :name => @name}
12
- hash_to_send[:value] = @value if @value
13
- xml.send(name, hash_to_send)
14
- end
15
- end
16
-