Sha256: 7512ac91a6402e2fbcf0372f94342cb4afa5e554c1a4f3c5dfec204c9b1e4a9b
Contents?: true
Size: 655 Bytes
Versions: 14
Compression:
Stored size: 655 Bytes
Contents
module With module Implementation def implemented_at?(file, line) (file.nil? || file == self.file) && (line.nil? || line.to_i == self.line) or respond_to?(:calls) && !calls.values.flatten.select{|call| call.implemented_at?(file, line) }.empty? or respond_to?(:parent) && parent && parent.implemented_at?(file, line) end def implementation @implementation ||= begin file, line = @block ? eval("[__FILE__, __LINE__]", @block) : [nil, nil] Hash[*[:file, :line].zip([file, line]).flatten] end end [:file, :line].each { |key| define_method(key) { implementation[key] } } end end
Version data entries
14 entries across 14 versions & 1 rubygems