Class: Integer
- Defined in
- lib/kyanite/numeric/integer.rb,
lib/kyanite/string/cast.rb
Numeric Additions
- Kyanite tests and examples
- Usage
-
require 'kyanite/numeric'
Instance Method Summary (collapse)
-
- (self) dup
self, you can not dup Integers.
-
- (self) to_integer
self, complements String#to_integer.
-
- (self) to_integer_optional
self, complements String#to_integer_optional.
-
- (Time) to_time
Converts a number of seconds-since-1970 in a Time object.
Instance Method Details
- (self) dup
self, you can not dup Integers
22 |
# File 'lib/kyanite/numeric/integer.rb', line 22 def dup; self; end |
- (self) to_integer
self, complements String#to_integer.
133 |
# File 'lib/kyanite/string/cast.rb', line 133 def to_integer; self; end |
- (self) to_integer_optional
self, complements String#to_integer_optional.
138 |
# File 'lib/kyanite/string/cast.rb', line 138 def to_integer_optional; self; end |
- (Time) to_time
Converts a number of seconds-since-1970 in a Time object
14 15 16 17 |
# File 'lib/kyanite/numeric/integer.rb', line 14 def to_time return nil if self > 2099999999 # geht leider nur bis ins Jahr 2036 ::Time.at(self) # ohne die Doppelpunkte sucht Ruby die Methode at in ::Time und wirft einen Error end |