lib/yaps.rb in yaps-0.0.1 vs lib/yaps.rb in yaps-0.0.2

- old
+ new

@@ -1,11 +1,38 @@ require 'wisper' require 'yaps/actions/creation' require 'yaps/actions/destruction' require 'yaps/actions/updation' +require 'yaps/configuration' require 'yaps/publisher' require 'yaps/subscriber' require "yaps/version" +begin + require "pry" +rescue LoadError +end + module Yaps - # Your code goes here... + class << self + attr_writer :configuration + end + + def self.configuration + @configuration ||= Configuration.new + end + + def self.reset + @configuration = Configuration.new + end + + def self.configure + yield(configuration) + end + + def self.with_pushlisher_enable &block + previous = configuration.enable + configuration.enable = true + block.call + configuration.enable = previous + end end