Class: Ice::ACMHeartbeat
- Inherits:
-
Object
- Object
- Ice::ACMHeartbeat
- Includes:
- Comparable
- Defined in:
- lib/Ice/Connection.rb
Constant Summary collapse
- HeartbeatOff =
ACMHeartbeat.new("HeartbeatOff", 0)
- HeartbeatOnDispatch =
ACMHeartbeat.new("HeartbeatOnDispatch", 1)
- HeartbeatOnIdle =
ACMHeartbeat.new("HeartbeatOnIdle", 2)
- HeartbeatAlways =
ACMHeartbeat.new("HeartbeatAlways", 3)
- @@_enumerators =
{0=>HeartbeatOff, 1=>HeartbeatOnDispatch, 2=>HeartbeatOnIdle, 3=>HeartbeatAlways}
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #hash ⇒ Object
-
#initialize(name, value) ⇒ ACMHeartbeat
constructor
A new instance of ACMHeartbeat.
- #to_i ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, value) ⇒ ACMHeartbeat
170 171 172 173 |
# File 'lib/Ice/Connection.rb', line 170 def initialize(name, value) @name = name @value = value end |
Class Method Details
._enumerators ⇒ Object
207 208 209 |
# File 'lib/Ice/Connection.rb', line 207 def ACMHeartbeat._enumerators @@_enumerators end |
.each(&block) ⇒ Object
196 197 198 |
# File 'lib/Ice/Connection.rb', line 196 def ACMHeartbeat.each(&block) @@_enumerators.each_value(&block) end |
.from_int(val) ⇒ Object
175 176 177 |
# File 'lib/Ice/Connection.rb', line 175 def ACMHeartbeat.from_int(val) @@_enumerators[val] end |
Instance Method Details
#<=>(other) ⇒ Object
187 188 189 190 |
# File 'lib/Ice/Connection.rb', line 187 def <=>(other) other.is_a?(ACMHeartbeat) or raise ArgumentError, "value must be a ACMHeartbeat" @value <=> other.to_i end |
#hash ⇒ Object
192 193 194 |
# File 'lib/Ice/Connection.rb', line 192 def hash @value.hash end |
#to_i ⇒ Object
183 184 185 |
# File 'lib/Ice/Connection.rb', line 183 def to_i @value end |
#to_s ⇒ Object
179 180 181 |
# File 'lib/Ice/Connection.rb', line 179 def to_s @name end |