Class: JavaBin::Pure::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/java_bin/pure/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeParser

Returns a new instance of Parser.



46
47
# File 'lib/java_bin/pure/parser.rb', line 46

def initialize
end

Instance Attribute Details

#currentObject (readonly)

Returns the value of attribute current.



44
45
46
# File 'lib/java_bin/pure/parser.rb', line 44

def current
  @current
end

#inputObject (readonly)

Returns the value of attribute input.



44
45
46
# File 'lib/java_bin/pure/parser.rb', line 44

def input
  @input
end

#tag_byteObject (readonly)

Returns the value of attribute tag_byte.



44
45
46
# File 'lib/java_bin/pure/parser.rb', line 44

def tag_byte
  @tag_byte
end

#versionObject (readonly)

Returns the value of attribute version.



44
45
46
# File 'lib/java_bin/pure/parser.rb', line 44

def version
  @version
end

Instance Method Details

#parse(input) ⇒ Object



49
50
51
52
53
54
55
56
57
# File 'lib/java_bin/pure/parser.rb', line 49

def parse(input)
  array = input.unpack("C*")
  check_version(array[0])
  @current = 0
  @input = array
  @version = getbyte
  @tag_byte = nil
  read_val
end