Module: JIJI::Util::Model

Included in:
Agent::Property, PeriodicallyRate, PeriodicallyRates, PeriodicallyValue, Rate, Rates
Defined in:
lib/jiji/util/util.rb

Overview

モデルオブジェクトの基底モジュール

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object

オブジェクト比較メソッド



111
112
113
# File 'lib/jiji/util/util.rb', line 111

def ==(other)
  _eql?(other) { |a,b| a == b }
end

#===(other) ⇒ Object



114
115
116
# File 'lib/jiji/util/util.rb', line 114

def ===(other)
  _eql?(other) { |a,b| a === b }
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


117
118
119
# File 'lib/jiji/util/util.rb', line 117

def eql?(other)
  _eql?(other) { |a,b| a.eql? b }
end

#hashObject



120
121
122
123
124
125
126
# File 'lib/jiji/util/util.rb', line 120

def hash
  hash = 0
  values.each {|v|
    hash = v.hash + 31 * hash
  }
  return hash
end