pauldix-sax-machine 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,14 +23,11 @@ module SAXMachine
23
23
  options[:as] ||= name
24
24
  sax_config.add_top_level_element(name, options)
25
25
 
26
- # we only want to insert the setter if they haven't defined it from elsewhere.
26
+ # we only want to insert the getter and setter if they haven't defined it from elsewhere.
27
27
  # this is how we allow custom parsing behavior. So you could define the setter
28
28
  # and have it parse the string into a date or whatever.
29
- if instance_methods.include?("#{options[:as]}=")
30
- attr_reader options[:as]
31
- else
32
- attr_accessor options[:as]
33
- end
29
+ attr_reader options[:as] unless instance_methods.include?(options[:as].to_s)
30
+ attr_writer options[:as] unless instance_methods.include?("#{options[:as]}=")
34
31
  end
35
32
 
36
33
  def elements(name, options = {})
data/lib/sax-machine.rb CHANGED
@@ -7,5 +7,5 @@ require "sax-machine/sax_handler"
7
7
  require "sax-machine/sax_config"
8
8
 
9
9
  module SAXMachine
10
- VERSION = "0.0.7"
10
+ VERSION = "0.0.9"
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pauldix-sax-machine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Dix
@@ -14,6 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri
17
+ type: :runtime
17
18
  version_requirement:
18
19
  version_requirements: !ruby/object:Gem::Requirement
19
20
  requirements: