Class: SwfRuby::DoActionDumper
- Inherits:
-
Object
- Object
- SwfRuby::DoActionDumper
- Defined in:
- lib/swf_ruby/do_action_dumper.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
-
#actions_addresses ⇒ Object
Returns the value of attribute actions_addresses.
-
#tag ⇒ Object
Returns the value of attribute tag.
Instance Method Summary collapse
- #dump(tag) ⇒ Object
-
#initialize ⇒ DoActionDumper
constructor
A new instance of DoActionDumper.
Constructor Details
#initialize ⇒ DoActionDumper
Returns a new instance of DoActionDumper.
10 11 12 13 |
# File 'lib/swf_ruby/do_action_dumper.rb', line 10 def initialize @actions = nil @actions_addresses = nil end |
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
7 8 9 |
# File 'lib/swf_ruby/do_action_dumper.rb', line 7 def actions @actions end |
#actions_addresses ⇒ Object
Returns the value of attribute actions_addresses.
8 9 10 |
# File 'lib/swf_ruby/do_action_dumper.rb', line 8 def actions_addresses @actions_addresses end |
#tag ⇒ Object
Returns the value of attribute tag.
6 7 8 |
# File 'lib/swf_ruby/do_action_dumper.rb', line 6 def tag @tag end |
Instance Method Details
#dump(tag) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/swf_ruby/do_action_dumper.rb', line 15 def dump(tag) @tag = tag @tag = @tag.force_encoding("ASCII-8BIT") if @tag.respond_to? :force_encoding record_header = @tag[0, 2].unpack("v").first t = Swf::Tag.new(@tag) # tag check raise NotDoActionTagError if t.code != 12 # length check raise InvalidTagLengthError if t.length != @tag.length @actions = [] @actions_addresses = [] = (t.long_header) ? 6 : 2 while < t.length @actions_addresses << ar = Swf::ActionRecord.new(@tag[..-1]) += ar.length @actions << ar end end |