You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fx/doc/ruby.md

390 B

Ruby Reducers

If any additional arguments was passed, fx converts it to a function which takes the JSON as an argument named x.

export FX_LANG=ruby

Example:

fx data.json 'x.to_a.map {|x| x[1]}'

Dot

Fx supports simple syntax for accessing data, which can be used with any FX_LANG.

$ echo '{"foo": [{"bar": "value"}]}' | fx .foo[0].bar
value