Module: Castaway::Production::Scenes
- Included in:
- Castaway::Production
- Defined in:
- lib/castaway/production/scenes.rb
Instance Method Summary collapse
- #_build_scenes ⇒ Object
-
#duration ⇒ Object
Returns the duration of the production, in seconds.
- #pointers ⇒ Object
- #resource(name) ⇒ Object
-
#scene(title) ⇒ Object
Returns the first scene with the given title.
Instance Method Details
#_build_scenes ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/castaway/production/scenes.rb', line 25 def _build_scenes @scenes = self.class.scenes.map do |(name, config)| Castaway::Scene.new(name, self).configure(&config) end @scenes = @scenes.sort_by(&:start) @scenes.each.with_index do |scene, index| scene.update_from_next(@scenes[index + 1]) end end |
#duration ⇒ Object
Returns the duration of the production, in seconds.
8 9 10 |
# File 'lib/castaway/production/scenes.rb', line 8 def duration @scenes.last.finish end |
#pointers ⇒ Object
21 22 23 |
# File 'lib/castaway/production/scenes.rb', line 21 def pointers self.class.pointers end |
#resource(name) ⇒ Object
17 18 19 |
# File 'lib/castaway/production/scenes.rb', line 17 def resource(name) self.class.resource(name) end |
#scene(title) ⇒ Object
Returns the first scene with the given title.
13 14 15 |
# File 'lib/castaway/production/scenes.rb', line 13 def scene(title) @scenes.find { |s| s.title == title } end |