Class: Ice::FormatType
Overview
The marshaling format for class instances.
Constant Summary collapse
- CompactFormat =
- SlicedFormat =
- @@_names =
['CompactFormat', 'SlicedFormat']
- @@_values =
[FormatType.new(0), FormatType.new(1)]
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #hash ⇒ Object
-
#initialize(val) ⇒ FormatType
constructor
A new instance of FormatType.
- #inspect ⇒ Object
- #to_i ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(val) ⇒ FormatType
Returns a new instance of FormatType.
51 52 53 54 |
# File 'ruby/Ice/Value.rb', line 51 def initialize(val) fail("invalid value #{val} for FormatType") unless(val >= 0 and val < 2) @val = val end |
Instance Method Details
#<=>(other) ⇒ Object
69 70 71 |
# File 'ruby/Ice/Value.rb', line 69 def <=>(other) @val <=> other.to_i if other.is_a?(FormatType) end |
#hash ⇒ Object
73 74 75 |
# File 'ruby/Ice/Value.rb', line 73 def hash @val.hash end |
#inspect ⇒ Object
77 78 79 |
# File 'ruby/Ice/Value.rb', line 77 def inspect @@_names[@val] + "(#{@val})" end |
#to_i ⇒ Object
65 66 67 |
# File 'ruby/Ice/Value.rb', line 65 def to_i @val end |
#to_s ⇒ Object
61 62 63 |
# File 'ruby/Ice/Value.rb', line 61 def to_s @@_names[@val] end |