Class: Eg::Music::Realtime
Constant Summary
Constants inherited
from Fit::Fixture
Fit::Fixture::GRAY, Fit::Fixture::GREEN, Fit::Fixture::RED, Fit::Fixture::YELLOW
Instance Attribute Summary
#format
Attributes inherited from Fit::Fixture
#args, #counts, #listener, #summary
Instance Method Summary
collapse
#do_cells, #do_table, #td
actor, actor=, #check, #do_cells, #start
camel, #check, #do_cell, #do_cells, #do_row, #do_rows, #do_table, #do_tables, #error, escape, #exception, #find_class, #fixture_name, #get_args_for_table, #get_linked_fixture_with_args, gray, #ignore, #info, #interpret_following_tables, #interpret_tables, label, metadata, #parse, #right, #total_errors, #totals, #wrong
Constructor Details
Returns a new instance of Realtime.
11
12
13
14
15
|
# File 'lib/eg/music/realtime.rb', line 11
def initialize
super
@system = Simulator.system
@system.reset
end
|
Instance Method Details
#await ⇒ Object
18
|
# File 'lib/eg/music/realtime.rb', line 18
def await; system('wait', cells.more); end
|
#enter ⇒ Object
20
21
22
23
|
# File 'lib/eg/music/realtime.rb', line 20
def enter
@system.delay 0.8
super
end
|
#fail ⇒ Object
19
|
# File 'lib/eg/music/realtime.rb', line 19
def fail; system('fail', cells.more); end
|
#pause ⇒ Object
17
|
# File 'lib/eg/music/realtime.rb', line 17
def pause; @system.delay(cells.more.text.to_f); end
|
#press ⇒ Object
24
25
26
27
|
# File 'lib/eg/music/realtime.rb', line 24
def press
@system.delay 1.2
super
end
|
#system(prefix, cell) ⇒ Object
28
29
30
31
32
33
34
35
|
# File 'lib/eg/music/realtime.rb', line 28
def system prefix, cell
method_name = Fit::Fixture.camel "#{prefix} #{cell.text}"
begin
@system.send(method_name)
rescue Exception => e
exception cell, e
end
end
|
#time ⇒ Object
16
|
# File 'lib/eg/music/realtime.rb', line 16
def time; Time.at(Simulator.time); end
|