Class: SwfRuby::Swf::SwfString
- Inherits:
-
Object
- Object
- SwfRuby::Swf::SwfString
- Defined in:
- lib/swf_ruby/swf/swf_string.rb
Instance Attribute Summary collapse
-
#length ⇒ Object
readonly
including StringEndMark.
-
#string ⇒ Object
Returns the value of attribute string.
Instance Method Summary collapse
-
#initialize(bytearray) ⇒ SwfString
constructor
A new instance of SwfString.
Constructor Details
#initialize(bytearray) ⇒ SwfString
Returns a new instance of SwfString.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/swf_ruby/swf/swf_string.rb', line 9 def initialize(bytearray) @length = 0 bytearray.each_byte do |byte| break if byte == 0 @length += 1 end @string = bytearray[0, @length] @length += 1 # Endmark self end |
Instance Attribute Details
#length ⇒ Object (readonly)
including StringEndMark
7 8 9 |
# File 'lib/swf_ruby/swf/swf_string.rb', line 7 def length @length end |
#string ⇒ Object
Returns the value of attribute string.
6 7 8 |
# File 'lib/swf_ruby/swf/swf_string.rb', line 6 def string @string end |