Class: SwfRuby::Swf::ActionRecord
- Inherits:
-
Object
- Object
- SwfRuby::Swf::ActionRecord
- Defined in:
- lib/swf_ruby/swf/action_record.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
Instance Method Summary collapse
-
#initialize(tag) ⇒ ActionRecord
constructor
A new instance of ActionRecord.
Constructor Details
#initialize(tag) ⇒ ActionRecord
Returns a new instance of ActionRecord.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/swf_ruby/swf/action_record.rb', line 10 def initialize(tag) tag.force_encoding("ASCII-8BIT") if tag.respond_to? :force_encoding # action code @code = tag[0].chr.unpack("C").first # length (including action record header) and data @length = 1 @data = nil if @code >= 0x80 len = tag[1,2].unpack("v").first @length += len + 2 @data = tag[3,len] end end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
6 7 8 |
# File 'lib/swf_ruby/swf/action_record.rb', line 6 def code @code end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
8 9 10 |
# File 'lib/swf_ruby/swf/action_record.rb', line 8 def data @data end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
7 8 9 |
# File 'lib/swf_ruby/swf/action_record.rb', line 7 def length @length end |