module Bundler::Plugin::Events
Public Class Methods
# File lib/bundler/plugin/events.rb, line 28 def self.defined_event?(event) @events ||= {} @events.key?(event) end
Check if an event has been defined @param event [String] An event to check @return [Boolean] A boolean indicating if the event has been defined
Private Class Methods
# File lib/bundler/plugin/events.rb, line 6 def self.define(const, event) const = const.to_sym.freeze if const_defined?(const) && const_get(const) != event raise ArgumentError, "Attempting to reassign #{const} to a different value" end const_set(const, event) unless const_defined?(const) @events ||= {} @events[event] = const end
# File lib/bundler/plugin/events.rb, line 17 def self.reset @events.each_value do |const| remove_const(const) end @events = nil end
Ruby Core © 1993–2017 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.