mirror of
https://github.com/tuna/mirror-web.git
synced 2025-12-26 04:52:44 +00:00
10 lines
217 B
Ruby
10 lines
217 B
Ruby
require "rubygems"
|
|
require "json"
|
|
|
|
module SelectFilter
|
|
def select(input, *selected)
|
|
input.map{ |o| o.to_liquid.hash_for_json.reject! { |k| not selected.include? k } }
|
|
end
|
|
Liquid::Template.register_filter self
|
|
end
|