huginn

https://github.com/cantino/huginn

Ruby

Create agents that monitor and act on your behalf. Your agents are standing by!

LiquidInterpolatable::Filters#as_object

Returns a Ruby object

It can be used as a JSONPath replacement for Agents that only support Liquid:

Event:   {"something": {"nested": {"data": 1}}}
Liquid:  {{something.nested | as_object}}
Returns: {"data": 1}

Splitting up a string with Liquid filters and return the Array:

Event:   {"data": "A,B,C"}}
Liquid:  {{data | split: ',' | as_object}}
Returns: ['A', 'B', 'C']

as_object ALWAYS has be the last filter in a Liquid expression!

Source | Google | Stack overflow

Edit

git clone [email protected]:cantino/huginn.git

cd huginn

open app/concerns/liquid_interpolatable.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-LiquidInterpolatable--Filters-as_object-for-pr


# Commit to git

git add app/concerns/liquid_interpolatable.rbgit commit -m "better docs for LiquidInterpolatable::Filters#as_object"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-LiquidInterpolatable--Filters-as_object-for-pr

hub pull-request


# Celebrate!