Parent

Introspection::Snapshot

Attributes

methods[R]

Public Class Methods

new(object) click to toggle source
# File lib/introspection/snapshot.rb, line 9
def initialize(object)
  @methods = (object.receivers rescue []).map do |receiver|
    [:public, :protected, :private].map do |visibility|
      query_method = "#{visibility}_instance_methods"
      receiver.send(query_method, false).map do |method|
        unbound_method = receiver.instance_method(method)
        if unbound_method.owner.equal?(receiver)
          Method.new(unbound_method, visibility)
        end
      end.compact
    end
  end.flatten
end

Public Instance Methods

changed?(other) click to toggle source
# File lib/introspection/snapshot.rb, line 30
def changed?(other)
  diff(other).values.flatten.any?
end
diff(other) click to toggle source
# File lib/introspection/snapshot.rb, line 23
def diff(other)
  {
    :added => other.methods - methods,
    :removed => methods - other.methods
  }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.