Class: Integer
- Defined in:
- lib/kyanite/numeric/integer.rb,
lib/kyanite/string/cast.rb
Overview
Instance Method Summary collapse
-
#dup ⇒ self
self
, you can not dup Integers. -
#to_integer ⇒ self
self
, complements String#to_integer. -
#to_integer_optional ⇒ self
self
, complements String#to_integer_optional. -
#to_time ⇒ Time
Converts a number of seconds-since-1970 in a Time object.
Instance Method Details
#dup ⇒ self
self
, you can not dup Integers
22 |
# File 'lib/kyanite/numeric/integer.rb', line 22 def dup; self; end |
#to_integer ⇒ self
self
, complements String#to_integer.
133 |
# File 'lib/kyanite/string/cast.rb', line 133 def to_integer; self; end |
#to_integer_optional ⇒ self
self
, complements String#to_integer_optional.
138 |
# File 'lib/kyanite/string/cast.rb', line 138 def to_integer_optional; self; end |
#to_time ⇒ 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 |