Module: WWMD::VSStubHelpers
- Includes:
- ViewStateUtils
- Included in:
- WWMD::VSStubs::VSArray, WWMD::VSStubs::VSBinarySerialized, WWMD::VSStubs::VSHashtable, WWMD::VSStubs::VSHybridDict, WWMD::VSStubs::VSIndexedStringRef, WWMD::VSStubs::VSIntEnum, WWMD::VSStubs::VSList, WWMD::VSStubs::VSPair, WWMD::VSStubs::VSReadValue, WWMD::VSStubs::VSSparseArray, WWMD::VSStubs::VSString, WWMD::VSStubs::VSStringArray, WWMD::VSStubs::VSStringFormatted, WWMD::VSStubs::VSTriplet, WWMD::VSStubs::VSType, WWMD::VSStubs::VSUnit, WWMD::VSStubs::VSValue
- Defined in:
- lib/wwmd/viewstate/vs_stubs/vs_stub_helpers.rb
Instance Method Summary
collapse
#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
Instance Method Details
#opcode ⇒ Object
9
10
11
|
# File 'lib/wwmd/viewstate/vs_stubs/vs_stub_helpers.rb', line 9
def opcode
return VIEWSTATE_TYPES.index(self.to_sym)
end
|
#serialize ⇒ Object
17
18
19
20
21
22
23
24
|
# File 'lib/wwmd/viewstate/vs_stubs/vs_stub_helpers.rb', line 17
def serialize
stack = ""
stack << self.write_byte(self.opcode)
if self.respond_to?(:typeref)
stack << self.serialize_type(self.typeref,self.typeval)
end
return stack
end
|
#size ⇒ Object
13
14
15
|
# File 'lib/wwmd/viewstate/vs_stubs/vs_stub_helpers.rb', line 13
def size
return @value.size
end
|
#to_sym ⇒ Object
5
6
7
|
# File 'lib/wwmd/viewstate/vs_stubs/vs_stub_helpers.rb', line 5
def to_sym
self.class.to_s.split(":").last.gsub(/[A-Z]+/,'\1_\0').downcase[1..-1].gsub(/\Avs/,"").to_sym
end
|
#to_xml ⇒ Object
26
27
28
29
30
31
32
33
34
|
# File 'lib/wwmd/viewstate/vs_stubs/vs_stub_helpers.rb', line 26
def to_xml
xml = REXML::Element.new(self.class.to_s.split(":").last)
if self.respond_to?(:typeref)
xml.add_attribute("typeref",self.typeref)
xml.add_attribute("typeval",self.typeval)
end
xml
end
|