Class: RBON::Load

Inherits:
Object
  • Object
show all
Defined in:
lib/rbon/load.rb

Defined Under Namespace

Classes: CloseArray, CloseHash, EOL, Error

Constant Summary collapse

X =
'\\'
XX =
X+X
XQ =
X+'"'
XN =
X+'n'
XT =
X+'t'
NILS =
/^nil,?$/
FALSES =
/^false,?$/
TRUES =
/^true,?$/
INTEGER =
/^\d+,?$/
FLOAT =
/^\d+\.\d+,?$/
KEY =
/^\w+[?!]?:/
SYMBOL =
/^:\w+[?!]?,?$/
STRING =
/^".*",?$/
STRINGS =
/^".*"\s*[+]$/
EMPTY_ARRAY =
/^\[\],?$/
OPEN_ARRAY =
'['
CLOSE_ARRAY =
/^\],?$/
EMPTY_HASH =
/^\{\},?$/
OPEN_HASH =
'{'
CLOSE_HASH =
/^\},?$/

Instance Method Summary collapse

Constructor Details

#initializeLoad

Returns a new instance of Load.



41
42
43
# File 'lib/rbon/load.rb', line 41

def initialize
  @opened, @io = 0, nil
end

Instance Method Details

#load(io) ⇒ Object



45
46
47
48
49
# File 'lib/rbon/load.rb', line 45

def load(io)
  @io = io
  readlines
  build
end