Class: WWMD::VSStubs::VSString
- Inherits:
-
Object
- Object
- WWMD::VSStubs::VSString
- Includes:
- WWMD::VSStubHelpers
- Defined in:
- lib/wwmd/viewstate/vs_stubs/vs_string.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(val) ⇒ VSString
constructor
A new instance of VSString.
- #serialize ⇒ Object
- #to_xml ⇒ Object
Methods included from WWMD::VSStubHelpers
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(val) ⇒ VSString
Returns a new instance of VSString.
7 8 9 |
# File 'lib/wwmd/viewstate/vs_stubs/vs_string.rb', line 7 def initialize(val) @value = val end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/wwmd/viewstate/vs_stubs/vs_string.rb', line 5 def value @value end |
Instance Method Details
#serialize ⇒ Object
11 12 13 14 15 16 |
# File 'lib/wwmd/viewstate/vs_stubs/vs_string.rb', line 11 def serialize stack = super stack << self.write_7bit_encoded_int(self.size) stack << self.value return stack end |
#to_xml ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/wwmd/viewstate/vs_stubs/vs_string.rb', line 18 def to_xml xml = super # emit quoted-printable if we need to if self.value =~ /[^\x20-\x7e]/ # xml.add_attribute("encoding","quoted-printable") # xml.add_text(self.value.to_qp) xml.add_attribute("encoding","urlencoded") xml.add_text(self.value.escape(/[^\x20-\x7e]/)) else xml.add_text(self.value) end xml end |