Class: Ice::ProtocolVersion
- Inherits:
-
Object
- Object
- Ice::ProtocolVersion
- Includes:
- Inspect_mixin
- Defined in:
- ruby/Ice/Version.rb
Instance Attribute Summary collapse
-
#major ⇒ Object
Returns the value of attribute major.
-
#minor ⇒ Object
Returns the value of attribute minor.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(major = 0, minor = 0) ⇒ ProtocolVersion
constructor
A new instance of ProtocolVersion.
Methods included from Inspect_mixin
Constructor Details
#initialize(major = 0, minor = 0) ⇒ ProtocolVersion
Returns a new instance of ProtocolVersion.
12 13 14 15 |
# File 'ruby/Ice/Version.rb', line 12 def initialize(major=0, minor=0) @major = major @minor = minor end |
Instance Attribute Details
#major ⇒ Object
Returns the value of attribute major.
35 36 37 |
# File 'ruby/Ice/Version.rb', line 35 def major @major end |
#minor ⇒ Object
Returns the value of attribute minor.
35 36 37 |
# File 'ruby/Ice/Version.rb', line 35 def minor @minor end |
Instance Method Details
#==(other) ⇒ Object
24 25 26 27 28 29 |
# File 'ruby/Ice/Version.rb', line 24 def ==(other) return false if !other.is_a? ::Ice::ProtocolVersion or @major != other.major or @minor != other.minor true end |
#eql?(other) ⇒ Boolean
31 32 33 |
# File 'ruby/Ice/Version.rb', line 31 def eql?(other) return other.class == self.class && other == self end |
#hash ⇒ Object
17 18 19 20 21 22 |
# File 'ruby/Ice/Version.rb', line 17 def hash _h = 0 _h = 5 * _h + @major.hash _h = 5 * _h + @minor.hash _h % 0x7fffffff end |