Class: Int
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Int
- Defined in:
- lib/activefacts/api/numeric.rb
Overview
It’s not possible to subclass Integer, so instead we delegate to it.
Direct Known Subclasses
Instance Method Summary collapse
-
#==(o) ⇒ Object
:nodoc:.
-
#eql?(o) ⇒ Boolean
:nodoc:.
-
#hash ⇒ Object
:nodoc:.
-
#initialize(i = nil) ⇒ Int
constructor
:nodoc:.
- #inspect ⇒ Object
-
#to_s ⇒ Object
:nodoc:.
Constructor Details
#initialize(i = nil) ⇒ Int
:nodoc:
16 17 18 |
# File 'lib/activefacts/api/numeric.rb', line 16 def initialize(i = nil) #:nodoc: __setobj__(Integer(i)) end |
Instance Method Details
#==(o) ⇒ Object
:nodoc:
32 33 34 |
# File 'lib/activefacts/api/numeric.rb', line 32 def ==(o) #:nodoc: __getobj__.==(o) end |
#eql?(o) ⇒ Boolean
:nodoc:
28 29 30 |
# File 'lib/activefacts/api/numeric.rb', line 28 def eql?(o) #:nodoc: self.class == o.class and __getobj__.eql?(Integer(o)) end |
#hash ⇒ Object
:nodoc:
24 25 26 |
# File 'lib/activefacts/api/numeric.rb', line 24 def hash #:nodoc: __getobj__.hash ^ self.class.hash end |
#inspect ⇒ Object
36 37 38 |
# File 'lib/activefacts/api/numeric.rb', line 36 def inspect "#{self.class.basename}:#{__getobj__.inspect}" end |
#to_s ⇒ Object
:nodoc:
20 21 22 |
# File 'lib/activefacts/api/numeric.rb', line 20 def to_s #:nodoc: __getobj__.to_s end |