ruby self.send如何理解

ruby self.send如何理解,ruby,Ruby,我正在读这样一个代码,如何理解这行的“self.send” class LogEntry attr_reader :term, :index, :command def initialize(term, index, command) @term, @index, @command = term, index, command end def ==(other) [:term, :index, :command].all? do |

我正在读这样一个代码,如何理解这行的“self.send”

  class LogEntry
    attr_reader :term, :index, :command

    def initialize(term, index, command)
      @term, @index, @command = term, index, command
    end

    def ==(other)
      [:term, :index, :command].all? do |attr|
        self.send(attr) == other.send(attr)
      end
    end

    def eql?(other)
      self == other
    end

    def hash
      [:term, :index, :command].reduce(0) do |h, attr|
        h ^= self.send(attr)
      end
    end
  end

谢谢

看起来像是一种奇特的方式:

self.send(attr) == other.send(attr)
你读过ruby doc吗?()重复:
self.term == other.term and
self.index == other.index and
self.comment == other.comment