Sha256: 2342b233b1ba9de9c8fcaec9147f9c8d68377b1f4cbc56bbb0f8279d357556a3

Contents?: true

Size: 587 Bytes

Versions: 4

Compression:

Stored size: 587 Bytes

Contents

module PageMagic
  class Element
    # module MethodObserver - adds methods to check if a methods have been added.
    module MethodObserver
      # Hook called by ruby when a singleton method is added.
      #
      # @param [String] arg name of the method added
      def singleton_method_added(arg)
        @singleton_methods_added = true unless arg == :singleton_method_added
      end

      # returns true if a singleton method has been added
      #
      # @return [Boolean]
      def singleton_methods_added?
        @singleton_methods_added == true
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
page_magic-1.0.0.alpha21 lib/page_magic/element/method_observer.rb
page_magic-1.0.0.alpha20 lib/page_magic/element/method_observer.rb
page_magic-1.0.0.alpha19 lib/page_magic/element/method_observer.rb
page_magic-1.0.0.alpha18 lib/page_magic/element/method_observer.rb