README.md in lou-0.1.0 vs README.md in lou-0.2.0
- old
+ new
@@ -13,20 +13,20 @@
~~~ruby
require 'lou'
class HashTransformer
- extend Lou
+ extend Lou::Transformer
- transform.up do |x|
+ step.up do |x|
x.merge(a_new_key: 'this is new')
end.down do |x|
x.delete(:a_new_key)
x
end
- transform.up do |x|
+ step.up do |x|
x.flatten
end.down do |x|
Hash[*x]
end
end
@@ -39,12 +39,12 @@
# [:an_old_key, "this is old", :a_new_key, "this is new"]
original = HashTransformer.reverse(result)
# {:an_old_key=>"this is old"}
~~~
-The transforms are applied in the order that they're defined using the ~apply~ function, with each transform receiving the result of the previous one. The process can be reversed using the ~reverse~ function.
+The transforms are applied in the order that they're defined using the ~apply~ function, with each transform receiving the result of the previous one. The process can be reversed using the ~reverse~ function. Note that for each step, the input is the result of the previous step.
-Note that for each transform, the input is the result of the previous step.
+Transformers inherit the steps of their parent class, so it's possible to reuse steps by using inheritance.
Credits
-------
Lou is heavily inspired by [Hash Mapper](http://github.com/ismasan) by [Ismael Celis](http://github.com/ismasan).
\ No newline at end of file