sleepy_penguin.git  about / heads / tags
Linux I/O events for Ruby
blob 5a5153608414ceb9bbb4728e2a10d8f681a632eb 320 bytes (raw)
$ git show v3.4.1:lib/sleepy_penguin/signalfd/sig_info.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
 
class SleepyPenguin::SignalFD::SigInfo # :nodoc:

  def to_hash
    Hash[*MEMBERS.inject([]) { |ary,k| ary << k << __send__(k) }]
  end

  def hash
    to_hash.hash
  end

  def inspect
    "#<#{self.class}:#{to_hash.inspect}>"
  end

  def ==(other)
    other.kind_of?(self.class) && to_hash == other.to_hash
  end
end

git clone https://yhbt.net/sleepy_penguin.git