Class: Spielbash::Movie
- Inherits:
-
Object
- Object
- Spielbash::Movie
- Defined in:
- lib/spielbash/model/movie.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
-
#context ⇒ Object
Returns the value of attribute context.
-
#output_path ⇒ Object
Returns the value of attribute output_path.
-
#post_run_actions ⇒ Object
Returns the value of attribute post_run_actions.
-
#pre_run_actions ⇒ Object
Returns the value of attribute pre_run_actions.
-
#session ⇒ Object
Returns the value of attribute session.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(title, pre_run_actions, actions, post_run_actions, context, output_path) ⇒ Movie
constructor
A new instance of Movie.
- #interrupt ⇒ Object
- #shoot ⇒ Object
Constructor Details
#initialize(title, pre_run_actions, actions, post_run_actions, context, output_path) ⇒ Movie
Returns a new instance of Movie.
5 6 7 8 9 10 11 12 |
# File 'lib/spielbash/model/movie.rb', line 5 def initialize(title, pre_run_actions, actions, post_run_actions, context, output_path) @title = title @pre_run_actions = pre_run_actions @actions = actions @post_run_actions = post_run_actions @context = context @output_path = output_path end |
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
3 4 5 |
# File 'lib/spielbash/model/movie.rb', line 3 def actions @actions end |
#context ⇒ Object
Returns the value of attribute context.
3 4 5 |
# File 'lib/spielbash/model/movie.rb', line 3 def context @context end |
#output_path ⇒ Object
Returns the value of attribute output_path.
3 4 5 |
# File 'lib/spielbash/model/movie.rb', line 3 def output_path @output_path end |
#post_run_actions ⇒ Object
Returns the value of attribute post_run_actions.
3 4 5 |
# File 'lib/spielbash/model/movie.rb', line 3 def post_run_actions @post_run_actions end |
#pre_run_actions ⇒ Object
Returns the value of attribute pre_run_actions.
3 4 5 |
# File 'lib/spielbash/model/movie.rb', line 3 def pre_run_actions @pre_run_actions end |
#session ⇒ Object
Returns the value of attribute session.
3 4 5 |
# File 'lib/spielbash/model/movie.rb', line 3 def session @session end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/spielbash/model/movie.rb', line 3 def title @title end |
Instance Method Details
#interrupt ⇒ Object
38 39 40 |
# File 'lib/spielbash/model/movie.rb', line 38 def interrupt Spielbash::PressKeyAction.new('C-c', context).execute(session) unless session.nil? end |
#shoot ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/spielbash/model/movie.rb', line 14 def shoot session = Spielbash::Session.new(title.downcase.split.join('_'), output_path, context) session.new_session pre_run_actions.each do |action| action.execute(session) end session.start_recording actions.each do |action| action.execute(session) end session.stop_recording post_run_actions.each do |action| action.execute(session) end session.stop_recording session.close_session end |