Class: FormatParser::MOOVParser::Decoder::Atom
- Inherits:
-
Struct
- Object
- Struct
- FormatParser::MOOVParser::Decoder::Atom
- Defined in:
- lib/parsers/moov_parser/decoder.rb
Instance Attribute Summary collapse
-
#at ⇒ Object
Returns the value of attribute at.
-
#atom_fields ⇒ Object
Returns the value of attribute atom_fields.
-
#atom_size ⇒ Object
Returns the value of attribute atom_size.
-
#atom_type ⇒ Object
Returns the value of attribute atom_type.
-
#children ⇒ Object
Returns the value of attribute children.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
Instance Attribute Details
#at ⇒ Object
Returns the value of attribute at
5 6 7 |
# File 'lib/parsers/moov_parser/decoder.rb', line 5 def at @at end |
#atom_fields ⇒ Object
Returns the value of attribute atom_fields
5 6 7 |
# File 'lib/parsers/moov_parser/decoder.rb', line 5 def atom_fields @atom_fields end |
#atom_size ⇒ Object
Returns the value of attribute atom_size
5 6 7 |
# File 'lib/parsers/moov_parser/decoder.rb', line 5 def atom_size @atom_size end |
#atom_type ⇒ Object
Returns the value of attribute atom_type
5 6 7 |
# File 'lib/parsers/moov_parser/decoder.rb', line 5 def atom_type @atom_type end |
#children ⇒ Object
Returns the value of attribute children
5 6 7 |
# File 'lib/parsers/moov_parser/decoder.rb', line 5 def children @children end |
#path ⇒ Object
Returns the value of attribute path
5 6 7 |
# File 'lib/parsers/moov_parser/decoder.rb', line 5 def path @path end |
Instance Method Details
#as_json(*a) ⇒ Object
14 15 16 17 18 |
# File 'lib/parsers/moov_parser/decoder.rb', line 14 def as_json(*a) members.each_with_object({}) do |member_name, o| o[member_name] = public_send(member_name).as_json(*a) end end |
#field_value(data_field) ⇒ Object
10 11 12 |
# File 'lib/parsers/moov_parser/decoder.rb', line 10 def field_value(data_field) (atom_fields || {}).fetch(data_field) end |
#to_s ⇒ Object
6 7 8 |
# File 'lib/parsers/moov_parser/decoder.rb', line 6 def to_s '%s (%s): %d bytes at offset %d' % [atom_type, path.join('.'), atom_size, at] end |