Yeah, helper functions like this should be outside the `collect_data` block. This will work, but it's defining the `run_ruby` method directly on a plugin _instance_ each time the `run` method gets called. E.g.,

```ruby
def run
  def run_ruby(args)
    # stuff
  end
end
```