You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+54-14Lines changed: 54 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# OrderTransformer
2
2
3
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/data_transformer`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+
Note: This gem is in maintenance mode and not actively updated.
4
4
5
-
TODO: Delete this and the text above, and describe your gem
5
+
The order transformer transforms data from an external format to the desired target format.
6
6
7
7
## Installation
8
8
@@ -12,18 +12,64 @@ Add this line to your application's Gemfile:
12
12
gem 'order_transformer'
13
13
```
14
14
15
-
And then execute:
15
+
And then run `bundle install`.
16
16
17
-
$ bundle install
17
+
## Usage
18
18
19
-
Or install it yourself as:
19
+
The gem allows you to define data transformations via a DSL like so:
20
20
21
-
$ gem install data_transformer
21
+
```ruby
22
+
OrderTransformer::DSL.define :some_shop, "v1.0"do
23
+
definition do
24
+
order as::hashdo
25
+
# The core of the transformation process is implemented by using the `transform` method. This maps the input "OrderNumber" field to the output "order_number" field.
26
+
transform "OrderNumber", to:"_order_number"
27
+
28
+
# By default, values of input data are not required to be set. To
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -50,9 +96,3 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
50
96
- create branch from master
51
97
- bump version to next pre `be gem bump -v pre --pretend` and after check `be gem bump -v pre`
52
98
- merge branch (merge commit!) into development
53
-
54
-
## Contributing
55
-
56
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/data_transformer.
0 commit comments