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

Add block usage #27

Open
aderyabin opened this issue Dec 6, 2017 · 2 comments
Open

Add block usage #27

aderyabin opened this issue Dec 6, 2017 · 2 comments

Comments

@aderyabin
Copy link
Owner

Add isolated usage support

sniffer = Sniffer.new do 
# some code here
end

sniffer.data

@dsalahutdinov
Copy link
Contributor

dsalahutdinov commented Dec 10, 2017

Hi Andrey, do you mean something like this?

class Sniffer
  def initialize
    @data = Data.new(singleton_config)

    Sniffer.enable!
    yield if block_given?
    ensure
      Sniffer.disable!
  end

  ...
end

With the singtone config instance but with separated instances for Sniffer.data

@aderyabin
Copy link
Owner Author

yes, you are right, I see it like that:

Sniffer.capture(config) do
# some code
end

And I thought about creating instances for Sniffer for with different configuration too.

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

2 participants