Skip to content

Simplify syntax further #11

Description

@ccallebs

The more I use this, the more I think it shouldn't be actual classes that define hooks, rather more simple "rspec-esque" blocks of code. For example:

class SampleHooks < Pokey
  define_hook "Optional description" do |hook|
    hook.interval = 10
    hook.endpoint = "http://blarg.com/api/endpoint"
    hook.http_method = :patch
    hook.data do |data|
      data.id = 1
      data.something_else = "string"
    end
  end

  define_hook do |hook|
    hook.interval = 5
    # etc
  end
end

Then you could simplify define as many hooks as you wanted in any given file. I'll shoot for release in 0.3.0.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions