match_point 0.0.2 → 0.0.3

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.
@@ -1,3 +1,3 @@
1
1
  module MatchPoint
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
@@ -35,22 +35,27 @@ module MatchPoint
35
35
  def synchronize_object_to_xml
36
36
  nodes_in_template = @template.xpath("//#{SPEC_NODE}")
37
37
  nodes_in_template.each do | node_in_template |
38
- define_reader_for node_in_template
38
+ define_accessors_for node_in_template
39
39
  @nodes_paths = @nodes_paths.merge ({ node_in_template.text.to_sym => node_in_template.path })
40
40
  end
41
41
  end
42
42
 
43
- def define_reader_for node_in_template
43
+ def define_accessors_for node_in_template
44
44
  attr_value = @xml.xpath(remove_spec_node_from(node_in_template.path)).text
45
45
  self.class.add_attr_reader_for node_in_template, attr_value
46
+ self.class.add_attr_writer_for node_in_template
47
+ end
48
+
49
+ def remove_spec_node_from a_path
50
+ a_path.gsub("/#{SPEC_NODE}", "")
46
51
  end
47
52
 
48
53
  def self.add_attr_reader_for node_in_template, attr_value
49
54
  define_method node_in_template.text.to_sym, lambda { attr_value }
50
55
  end
51
56
 
52
- def remove_spec_node_from a_path
53
- a_path.gsub("/#{SPEC_NODE}", "")
57
+ def self.add_attr_writer_for node_in_template
58
+ define_method (node_in_template.text).concat('=').to_sym, lambda { | new_value | self.class.add_attr_reader_for node_in_template, new_value }
54
59
  end
55
60
 
56
61
  end
@@ -45,6 +45,12 @@ describe MatchPoint do
45
45
  "
46
46
  end
47
47
 
48
+ it "should allow set a particular value" do
49
+ other_value = "oTHeRVaLue"
50
+ response.auth_id = other_value
51
+ response.auth_id.should == other_value
52
+ end
53
+
48
54
  end
49
55
 
50
56
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: match_point
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: