Module: NyanCatFormat::Music
- Defined in:
- lib/nyan_cat_format/music.rb
Instance Method Summary collapse
- #dump_summary(*args) ⇒ Object
- #kernel ⇒ Object
- #kernel=(kernel) ⇒ Object
- #linux? ⇒ Boolean
- #nyan_mp3 ⇒ Object
- #osx? ⇒ Boolean
- #platform ⇒ Object
- #platform=(platform) ⇒ Object
- #start(input) ⇒ Object
Instance Method Details
#dump_summary(*args) ⇒ Object
38 39 40 41 |
# File 'lib/nyan_cat_format/music.rb', line 38 def dump_summary(*args) kill_music super end |
#kernel ⇒ Object
16 17 18 |
# File 'lib/nyan_cat_format/music.rb', line 16 def kernel @kernel ||= Kernel end |
#kernel=(kernel) ⇒ Object
12 13 14 |
# File 'lib/nyan_cat_format/music.rb', line 12 def kernel=(kernel) @kernel = kernel end |
#linux? ⇒ Boolean
8 9 10 |
# File 'lib/nyan_cat_format/music.rb', line 8 def linux? platform.downcase.include?('linux') end |
#nyan_mp3 ⇒ Object
28 29 30 |
# File 'lib/nyan_cat_format/music.rb', line 28 def nyan_mp3 File.('../../../data/nyan-cat.mp3', __FILE__) end |
#osx? ⇒ Boolean
4 5 6 |
# File 'lib/nyan_cat_format/music.rb', line 4 def osx? platform.downcase.include?("darwin") end |
#platform ⇒ Object
24 25 26 |
# File 'lib/nyan_cat_format/music.rb', line 24 def platform @platform ||= RUBY_PLATFORM end |
#platform=(platform) ⇒ Object
20 21 22 |
# File 'lib/nyan_cat_format/music.rb', line 20 def platform=(platform) @platform = platform end |
#start(input) ⇒ Object
32 33 34 35 36 |
# File 'lib/nyan_cat_format/music.rb', line 32 def start input super @music_thread = Thread.new { start_music_or_kill(Thread.current) } wait_for_music_to_start(@music_thread) end |