activedocument 0.6 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ActiveDocument/active_document.rb +7 -1
- metadata +7 -17
@@ -54,6 +54,11 @@ module ActiveDocument
|
|
54
54
|
# Attribute accessors always return instances of ActiveDocument::ActiveDocument::PartialResult. This class works just
|
55
55
|
# like a regular ActiveDocument::ActiveDocument::Base object in that you access its members like regular properties.
|
56
56
|
#
|
57
|
+
# NOTE: Ruby does NOT support hyphens in method names. Because of this if you have an element called, for example,
|
58
|
+
# version-number, you CAN'T do x.version-number to access the version-number element. To work around this problem
|
59
|
+
# substitute the word HYPHEN (all caps) for any - in your elements names. In the previous exmaple using
|
60
|
+
# x.versionHYPHENnumber will correctly resolve to the version-number element.
|
61
|
+
#
|
57
62
|
# More complex dynamic accessors are also supported. Instead of just looking
|
58
63
|
# for an element anywhere in the document, you can be more specific. For example, domain_object.chapter.paragraph
|
59
64
|
# will find all paragraph elements that are children of chapter elements.
|
@@ -116,7 +121,8 @@ module ActiveDocument
|
|
116
121
|
def method_missing(method_id, * arguments, & block)
|
117
122
|
@@log.debug("ActiveDocument::Base at line #{__LINE__}: method called is #{method_id} with arguments #{arguments}")
|
118
123
|
method = method_id.to_s
|
119
|
-
|
124
|
+
method = method.sub("HYPHEN","-")
|
125
|
+
if method =~ /^(\w*-?\w*)$/ # methods with no '.' in them and not ending in '='
|
120
126
|
if arguments.length > 0
|
121
127
|
super
|
122
128
|
end
|
metadata
CHANGED
@@ -1,11 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activedocument
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 6
|
8
|
-
version: "0.6"
|
4
|
+
prerelease:
|
5
|
+
version: 0.6.1
|
9
6
|
platform: ruby
|
10
7
|
authors:
|
11
8
|
- Clark D. Richey, Jr.
|
@@ -13,20 +10,16 @@ autorequire:
|
|
13
10
|
bindir: bin
|
14
11
|
cert_chain: []
|
15
12
|
|
16
|
-
date:
|
17
|
-
default_executable:
|
13
|
+
date: 2011-04-09 00:00:00 Z
|
18
14
|
dependencies:
|
19
15
|
- !ruby/object:Gem::Dependency
|
20
16
|
name: nokogiri
|
21
17
|
prerelease: false
|
22
18
|
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
23
20
|
requirements:
|
24
21
|
- - ">="
|
25
22
|
- !ruby/object:Gem::Version
|
26
|
-
segments:
|
27
|
-
- 1
|
28
|
-
- 4
|
29
|
-
- 1
|
30
23
|
version: 1.4.1
|
31
24
|
type: :runtime
|
32
25
|
version_requirements: *id001
|
@@ -50,7 +43,6 @@ files:
|
|
50
43
|
- lib/ActiveDocument/search_results.rb
|
51
44
|
- lib/active_document.rb
|
52
45
|
- lib/activedocument.rb
|
53
|
-
has_rdoc: true
|
54
46
|
homepage: http://github.com/crichey/ActiveDocument
|
55
47
|
licenses: []
|
56
48
|
|
@@ -60,23 +52,21 @@ rdoc_options: []
|
|
60
52
|
require_paths:
|
61
53
|
- lib
|
62
54
|
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
63
56
|
requirements:
|
64
57
|
- - ">="
|
65
58
|
- !ruby/object:Gem::Version
|
66
|
-
segments:
|
67
|
-
- 0
|
68
59
|
version: "0"
|
69
60
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
70
62
|
requirements:
|
71
63
|
- - ">="
|
72
64
|
- !ruby/object:Gem::Version
|
73
|
-
segments:
|
74
|
-
- 0
|
75
65
|
version: "0"
|
76
66
|
requirements: []
|
77
67
|
|
78
68
|
rubyforge_project:
|
79
|
-
rubygems_version: 1.
|
69
|
+
rubygems_version: 1.7.2
|
80
70
|
signing_key:
|
81
71
|
specification_version: 3
|
82
72
|
summary: Object Mapper for XML Database
|