class LolBaser::Lol

Public Class Methods

get(n) click to toggle source
# File lib/lolbaser.rb, line 15
def self.get n
  n = n.to_i
  return Lol.new(n)
end
new(n=0) click to toggle source
# File lib/lolbaser.rb, line 5
def initialize n=0
  @n = n
  return self
end
to_i(n) click to toggle source
# File lib/lolbaser.rb, line 25
def self.to_i n
  n = n.to_i
  out = ""
  while n >= 3
    lol = rand 0..2
    n -= 2**lol
    out << LolBaser::LOL[lol]
  end
  out << LolBaser::LOL[n - 1] if n > 0
end

Public Instance Methods

get(n=nil) click to toggle source
# File lib/lolbaser.rb, line 10
def get n=nil
  @n = n unless n != nil
  return self
end
to_i(n=nil) click to toggle source
# File lib/lolbaser.rb, line 20
def to_i n=nil
  return Lol.to_i(n) if n != nil
  return Lol.to_i(@n)
end