Method: String#b
- Defined in:
- lib/radix/operator.rb
#b(base = nil) ⇒ Radix::Integer, Radix::Float
Takes a String and makes it into a Radix::Integer or Radix::Float as given base. Float is determined by a “.” character in string instance
62 63 64 65 66 67 68 69 70 |
# File 'lib/radix/operator.rb', line 62 def b(base=nil) return ascii unless base if index('.') Radix::Float.new(self, base) else Radix::Integer.new(self, base) end end |