Numbers::Rational
Inherits Reference < Object
should this be made struct?
Constructors
Class methods
[](s : String)
Sourceeight
Sourcefive
Sourcefour
Sourcenine
Sourceone
Sourceseven
Sourcesix
Sourcethree
Sourcetwo
Sourcezero
SourceInstance methods
*(r : self)
Source+(r : self)
Source-(r : self)
Source/(r : self)
Sourceden
Sourcedenominator
Sourcenegative?
Sourcenum
Sourcenumerator
Sourceto_i
Sourceto_s(io : IO) : Nil
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Macros
define_bin_operations_with_integers(*bin_ops)
Sourcedefine_rational_integers(hash_node)
Source