Class: Pdfrb::Model::Type::Timespan
- Inherits:
-
Cos::Dictionary
- Object
- Object
- Cos::Dictionary
- Pdfrb::Model::Type::Timespan
- Defined in:
- lib/pdfrb/model/type/timespan.rb
Overview
Timespan (ISO 32000-2 §12.7.11, PDF 1.5+). A duration with a unit, used in RichMedia timing, 3D animation, and JavaScript-embedded timelines.
Instance Attribute Summary
Attributes inherited from Object
Instance Method Summary collapse
-
#duration ⇒ Object
/V — required, the numeric duration in seconds.
-
#milliseconds ⇒ Object
Convenience: duration in milliseconds.
-
#subtype ⇒ Object
/S — required, fixed "S" (seconds).
-
#type ⇒ Object
/Type — optional, fixed "Timespan".
Methods inherited from Cos::Dictionary
#[], #[]=, arlington_available?, arlington_default, arlington_key_to_symbol, arlington_loaded_for?, arlington_mark_loaded, arlington_object, arlington_one_type_to_ruby, arlington_required?, arlington_types_to_ruby, arlington_version, define_field, define_field_from_arlington, #delete, #each, each_field, #each_raw, #empty?, field, #initialize, #key?, #keys, lookup_type, own_fields, #pdf_type, register_type, type_map, #validate
Methods inherited from Object
#==, define_type, #deref, #indirect?, #initialize, #must_be_indirect?, #pdf_type, pdf_type
Constructor Details
This class inherits a constructor from Pdfrb::Model::Cos::Dictionary
Instance Method Details
#duration ⇒ Object
/V — required, the numeric duration in seconds.
23 24 25 |
# File 'lib/pdfrb/model/type/timespan.rb', line 23 def duration value[:V] end |
#milliseconds ⇒ Object
Convenience: duration in milliseconds.
28 29 30 31 |
# File 'lib/pdfrb/model/type/timespan.rb', line 28 def milliseconds v = duration v ? v.to_f * 1000 : nil end |
#subtype ⇒ Object
/S — required, fixed "S" (seconds).
18 19 20 |
# File 'lib/pdfrb/model/type/timespan.rb', line 18 def subtype value[:S]&.to_sym end |
#type ⇒ Object
/Type — optional, fixed "Timespan".
13 14 15 |
# File 'lib/pdfrb/model/type/timespan.rb', line 13 def type value[:Type]&.to_sym end |