module Danger::Helpers::ArraySubclass
Attributes
Public Class Methods
Source
# File lib/danger/helpers/array_subclass.rb, line 6 def initialize(array) @__array__ = array end
Public Instance Methods
Source
# File lib/danger/helpers/array_subclass.rb, line 34 def <=>(other) return unless other.kind_of?(self.class) __array__ <=> other.instance_variable_get(:@__array__) end
Source
# File lib/danger/helpers/array_subclass.rb, line 10 def kind_of?(compare_class) return true if compare_class == self.class dummy.kind_of?(compare_class) end
Source
# File lib/danger/helpers/array_subclass.rb, line 16 def method_missing(name, *args, &block) super unless __array__.respond_to?(name) respond_to_method(name, *args, &block) end
Calls superclass method
Source
# File lib/danger/helpers/array_subclass.rb, line 22 def respond_to_missing?(name, include_all) __array__.respond_to?(name, include_all) || super end
Calls superclass method
Private Instance Methods
Source
# File lib/danger/helpers/array_subclass.rb, line 44 def dummy Class.new(Array).new end
Source
# File lib/danger/helpers/array_subclass.rb, line 48 def respond_to_method(name, *args, &block) result = __array__.send(name, *args, &block) return result unless result.kind_of?(Array) if name =~ /!/ __array__ = result self else self.class.new(result) end end