Class: WWMD::VSStubs::VSValue

Inherits:
Object
  • Object
show all
Includes:
WWMD::VSStubHelpers
Defined in:
lib/wwmd/viewstate/vs_stubs/vs_value.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WWMD::VSStubHelpers

#size

Methods included from WWMD::ViewStateUtils

#deserialize_type, #dlog, #magic?, #next_type, #offset, #putd, #read, #read_7bit_encoded_int, #read_double, #read_int, #read_int32, #read_raw_byte, #read_short, #read_string, #serialize_type, #slog, #throw, #write_7bit_encoded_int, #write_double, #write_int, #write_int32, #write_short

Constructor Details

#initialize(str) ⇒ VSValue

gin up all the single byte values



8
9
10
# File 'lib/wwmd/viewstate/vs_stubs/vs_value.rb', line 8

def initialize(str)
  @value = str
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



5
6
7
# File 'lib/wwmd/viewstate/vs_stubs/vs_value.rb', line 5

def value
  @value
end

Instance Method Details

#opcodeObject



20
21
22
# File 'lib/wwmd/viewstate/vs_stubs/vs_value.rb', line 20

def opcode
  @value
end

#serializeObject



24
25
26
# File 'lib/wwmd/viewstate/vs_stubs/vs_value.rb', line 24

def serialize
  super # cheat... just return opcode
end

#to_sObject



12
13
14
# File 'lib/wwmd/viewstate/vs_stubs/vs_value.rb', line 12

def to_s
  @value.hexify
end

#to_symObject



16
17
18
# File 'lib/wwmd/viewstate/vs_stubs/vs_value.rb', line 16

def to_sym
  VIEWSTATE_TYPES[opcode].to_sym
end

#to_xmlObject



28
29
30
31
32
# File 'lib/wwmd/viewstate/vs_stubs/vs_value.rb', line 28

def to_xml
  xml = super
  xml.add_text(self.to_sym.to_s)
  xml
end