Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify syntax further #11

Open
ccallebs opened this issue Sep 11, 2015 · 1 comment
Open

Simplify syntax further #11

ccallebs opened this issue Sep 11, 2015 · 1 comment
Milestone

Comments

@ccallebs
Copy link
Owner

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.

@ccallebs ccallebs added this to the 0.3.0 milestone Sep 11, 2015
@ccallebs
Copy link
Owner Author

This will break compatibility with ccallebs/pokey-sendgrid but should be easy enough to fix.

@ccallebs ccallebs modified the milestones: 1.0.0, 0.3.0 May 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant