{"action":"created","issue":{"url":"https://api.github.com/repos/Shopify/liquid/issues/558","labels_url":"https://api.github.com/repos/Shopify/liquid/issues/558/labels{/name}","comments_url":"https://api.github.com/repos/Shopify/liquid/issues/558/comments","events_url":"https://api.github.com/repos/Shopify/liquid/issues/558/events","html_url":"https://github.com/Shopify/liquid/pull/558","id":75334100,"number":558,"title":"Allow for a block to be passed on liquid_methods that can transform…","user":{"login":"rovermicrover","id":1587624,"avatar_url":"https://avatars.githubusercontent.com/u/1587624?v=3","gravatar_id":"","url":"https://api.github.com/users/rovermicrover","html_url":"https://github.com/rovermicrover","followers_url":"https://api.github.com/users/rovermicrover/followers","following_url":"https://api.github.com/users/rovermicrover/following{/other_user}","gists_url":"https://api.github.com/users/rovermicrover/gists{/gist_id}","starred_url":"https://api.github.com/users/rovermicrover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rovermicrover/subscriptions","organizations_url":"https://api.github.com/users/rovermicrover/orgs","repos_url":"https://api.github.com/users/rovermicrover/repos","events_url":"https://api.github.com/users/rovermicrover/events{/privacy}","received_events_url":"https://api.github.com/users/rovermicrover/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-05-11T19:37:47Z","updated_at":"2015-05-13T18:00:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Shopify/liquid/pulls/558","html_url":"https://github.com/Shopify/liquid/pull/558","diff_url":"https://github.com/Shopify/liquid/pull/558.diff","patch_url":"https://github.com/Shopify/liquid/pull/558.patch"},"body":"…the allowed methods return value. Useful for sanitization and dynamic content.\r\n\r\nAdded comment explains it best.\r\n\r\nYou may also pass a block that can be used to transform the method's returned value.\r\n\r\n```ruby\r\nclass SomeClass\r\n  liquid_methods :an_allowed_method do |object, method, value|\r\n    if value.is_a?(String)\r\n      value += ' that has been transformed'\r\n    else\r\n      value\r\n    end\r\n  end\r\n\r\n  def an_allowed_method\r\n    'this comes from an allowed method'\r\n  end\r\n\r\nend\r\n```\r\nusage:\r\n```ruby\r\n@something = SomeClass.new\r\n```\r\ntemplate:\r\n```ruby\r\n{{something.an_allowed_method}}\r\n```\r\noutput:\r\n```ruby\r\n'this comes from an allowed method that has been transformed'\r\n```\r\n@boourns, @fw42, @camilo, @dylanahsmith, or @arthurnn"},"comment":{"url":"https://api.github.com/repos/Shopify/liquid/issues/comments/101760401","html_url":"https://github.com/Shopify/liquid/pull/558#issuecomment-101760401","issue_url":"https://api.github.com/repos/Shopify/liquid/issues/558","id":101760401,"user":{"login":"boourns","id":699550,"avatar_url":"https://avatars.githubusercontent.com/u/699550?v=3","gravatar_id":"","url":"https://api.github.com/users/boourns","html_url":"https://github.com/boourns","followers_url":"https://api.github.com/users/boourns/followers","following_url":"https://api.github.com/users/boourns/following{/other_user}","gists_url":"https://api.github.com/users/boourns/gists{/gist_id}","starred_url":"https://api.github.com/users/boourns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boourns/subscriptions","organizations_url":"https://api.github.com/users/boourns/orgs","repos_url":"https://api.github.com/users/boourns/repos","events_url":"https://api.github.com/users/boourns/events{/privacy}","received_events_url":"https://api.github.com/users/boourns/received_events","type":"User","site_admin":false},"created_at":"2015-05-13T18:00:59Z","updated_at":"2015-05-13T18:00:59Z","body":"I don't think this should live in liquid core, sorry."}}