Class: Shoes::Sound

Inherits:
Object
  • Object
show all
Includes:
Common::Inspect
Defined in:
shoes-core/lib/shoes/sound.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Common::Inspect

#inspect, #to_s

Constructor Details

#initialize(parent, filepath, _opts = {}, &_blk) ⇒ Sound

Returns a new instance of Sound.



7
8
9
10
11
12
13
# File 'shoes-core/lib/shoes/sound.rb', line 7

def initialize(parent, filepath, _opts = {}, &_blk)
  @app    = parent
  @parent = parent
  @filepath = filepath

  @gui = Shoes.backend_for(self)
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



15
16
17
# File 'shoes-core/lib/shoes/sound.rb', line 15

def app
  @app
end

#filepathObject (readonly)

Returns the value of attribute filepath.



15
16
17
# File 'shoes-core/lib/shoes/sound.rb', line 15

def filepath
  @filepath
end

#guiObject (readonly)

Returns the value of attribute gui.



15
16
17
# File 'shoes-core/lib/shoes/sound.rb', line 15

def gui
  @gui
end

#parentObject (readonly)

Returns the value of attribute parent.



15
16
17
# File 'shoes-core/lib/shoes/sound.rb', line 15

def parent
  @parent
end

Instance Method Details

#playObject



17
18
19
# File 'shoes-core/lib/shoes/sound.rb', line 17

def play
  @gui.play
end