Class: Stagecraft::Animation::Clip
- Inherits:
-
Object
- Object
- Stagecraft::Animation::Clip
- Defined in:
- lib/stagecraft/animation/clip.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tracks ⇒ Object
readonly
Returns the value of attribute tracks.
Instance Method Summary collapse
-
#initialize(name: nil, tracks:, duration: nil) ⇒ Clip
constructor
A new instance of Clip.
Constructor Details
#initialize(name: nil, tracks:, duration: nil) ⇒ Clip
Returns a new instance of Clip.
8 9 10 11 12 |
# File 'lib/stagecraft/animation/clip.rb', line 8 def initialize(name: nil, tracks:, duration: nil) @name = name @tracks = tracks.freeze @duration = duration ? Float(duration) : (@tracks.map(&:duration).max || 0.0) end |
Instance Attribute Details
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
6 7 8 |
# File 'lib/stagecraft/animation/clip.rb', line 6 def duration @duration end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/stagecraft/animation/clip.rb', line 6 def name @name end |
#tracks ⇒ Object (readonly)
Returns the value of attribute tracks.
6 7 8 |
# File 'lib/stagecraft/animation/clip.rb', line 6 def tracks @tracks end |