rif-cs 1.0.0 → 1.1.0

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.1.0
@@ -3,7 +3,7 @@ module RIFCS
3
3
  include RIFCS
4
4
  require 'nokogiri'
5
5
 
6
- def to_rifcs(encoding='UTF-8')
6
+ def to_registry_node(encoding='UTF-8')
7
7
  Nokogiri::XML::Builder.new(:encoding => encoding) do |xml|
8
8
  xml.registryObject_(:group => activity_group) do
9
9
 
@@ -3,7 +3,7 @@ module RIFCS
3
3
  include RIFCS
4
4
  require 'nokogiri'
5
5
 
6
- def to_rifcs(encoding='UTF-8')
6
+ def to_registry_node(encoding='UTF-8')
7
7
  Nokogiri::XML::Builder.new(:encoding => encoding) do |xml|
8
8
  xml.registryObject_(:group => collection_group) do
9
9
 
data/lib/rif-cs/party.rb CHANGED
@@ -3,7 +3,7 @@ module RIFCS
3
3
  include RIFCS
4
4
  require 'nokogiri'
5
5
 
6
- def to_rifcs(encoding='UTF-8')
6
+ def to_registry_node(encoding='UTF-8')
7
7
  Nokogiri::XML::Builder.new(:encoding => encoding) do |xml|
8
8
  xml.registryObject_(:group => party_group) do
9
9
 
@@ -40,6 +40,5 @@ module RIFCS
40
40
  raise "Supply a party_key attribute or implement a method"
41
41
  end
42
42
 
43
-
44
43
  end
45
44
  end
@@ -3,7 +3,7 @@ module RIFCS
3
3
  include RIFCS
4
4
  require 'nokogiri'
5
5
 
6
- def to_rifcs(encoding='UTF-8')
6
+ def to_registry_node(encoding='UTF-8')
7
7
  Nokogiri::XML::Builder.new(:encoding => encoding) do |xml|
8
8
  xml.registryObject_(:group => service_group) do
9
9
  xml.key_ service_key
data/lib/rif-cs.rb CHANGED
@@ -163,5 +163,17 @@ module RIFCS
163
163
  end
164
164
  end
165
165
 
166
+ def to_rif(encoding='UTF-8')
167
+ reg_obj = to_registry_node
168
+ doc = Nokogiri::XML::Document.new
169
+ doc.encoding = encoding
170
+ container = Nokogiri::XML::Node.new('registryObjects', doc)
171
+ container['xsi:schemaLocation'] = 'http://ands.org.au/standards/rif-cs/registryObjects http://services.ands.org.au/documentation/rifcs/1.3/schema/registryObjects.xsd'
172
+ doc.root = container
173
+ reg_elems = reg_obj.doc.root.dup
174
+ container.add_child(reg_elems)
175
+ doc.to_xml
176
+ end
177
+
166
178
  end
167
179
 
data/rif-cs.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "rif-cs"
8
- s.version = "1.0.0"
8
+ s.version = "1.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Sean McCarthy"]
12
- s.date = "2012-06-25"
12
+ s.date = "2012-07-10"
13
13
  s.description = "Instrument your class to return RIF-CS"
14
14
  s.email = "sean@intersect.org.au"
15
15
  s.extra_rdoc_files = [
@@ -31,14 +31,12 @@ Gem::Specification.new do |s|
31
31
  "lib/rif-cs/party.rb",
32
32
  "lib/rif-cs/service.rb",
33
33
  "rif-cs.gemspec",
34
+ "spec/example_models.rb",
34
35
  "spec/files/activity.xml",
35
36
  "spec/files/collection.xml",
36
37
  "spec/files/party.xml",
37
38
  "spec/files/service.xml",
38
- "spec/rif-cs_activity_spec.rb",
39
- "spec/rif-cs_collection_spec.rb",
40
- "spec/rif-cs_party_spec.rb",
41
- "spec/rif-cs_service_spec.rb",
39
+ "spec/rif-cs_records.rb",
42
40
  "spec/rif-cs_spec.rb",
43
41
  "spec/spec_helper.rb"
44
42
  ]