Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/radix.rb,
lib/radix/rational.rb

Instance Method Summary collapse

Instance Method Details

#b(base) ⇒ Object



34
35
36
37
38
39
40
# File 'lib/radix.rb', line 34

def b(base)
  if index('.')
    Radix::Float.new(self, base)
  else
    Radix::Integer.new(self, base)
  end
end

#br(base = nil) ⇒ Object

Convenience method for creating a Radix::Rational. TODO: Keep #br? Or find another way?



188
189
190
191
192
# File 'lib/radix/rational.rb', line 188

def br(base=nil)
  args = dup
  args << base if base
  Radix::Rational.new(*args)
end