cwyckoff-babel_icious 0.0.4.4 → 0.0.4.5
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/README.rdoc +2 -2
- data/lib/babel_icious/mapper.rb +3 -3
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -19,7 +19,7 @@ Mappings are set up by calling passing mapping 'coordinates' to a 'config' block
|
|
19
19
|
|
20
20
|
Babelicious::Mapper.config(:foo) do |m|
|
21
21
|
|
22
|
-
m.direction
|
22
|
+
m.direction :from => :xml, :to => :hash
|
23
23
|
|
24
24
|
m.map :from => "foo/bar", :to => "bar/foo"
|
25
25
|
m.map :from => "foo/baz", :to => "bar/boo"
|
@@ -30,7 +30,7 @@ Mappings are set up by calling passing mapping 'coordinates' to a 'config' block
|
|
30
30
|
|
31
31
|
The 'config' method takes a symbol as its first argument which serves as an identification tag for that mapping. The second argument is a block where you indiate the details of your mapping. This should include a direction indicator and individual mapping 'coordinates'.
|
32
32
|
|
33
|
-
m.direction
|
33
|
+
m.direction :from => :xml, :to => :hash
|
34
34
|
|
35
35
|
tells the mapper that the source of the mapping will be xml and the target will be a hash. And the mapping coordinates
|
36
36
|
|
data/lib/babel_icious/mapper.rb
CHANGED
@@ -14,8 +14,8 @@ module Babelicious
|
|
14
14
|
yield self
|
15
15
|
end
|
16
16
|
|
17
|
-
def direction
|
18
|
-
current_target_mapper.direction = dir
|
17
|
+
def direction(dir={})
|
18
|
+
current_target_mapper.direction = @direction = dir
|
19
19
|
end
|
20
20
|
|
21
21
|
def map(opts={})
|
@@ -28,7 +28,7 @@ module Babelicious
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def reset
|
31
|
-
@mapped_targets, @direction = nil,
|
31
|
+
@mapped_targets, @direction = nil, {}
|
32
32
|
end
|
33
33
|
|
34
34
|
def translate(key=nil, source=nil)
|