Class: Metro::Sample
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Metro::Sample
- Defined in:
- lib/metro/sample.rb
Overview
Sample is a wrapper class for a Gosu Sample. This allows for additional data to be stored without relying on monkey-patching on functionality.
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#sample ⇒ Object
Returns the value of attribute sample.
Class Method Summary collapse
-
.create(options) ⇒ Object
Create a sample given the window and path.
Instance Method Summary collapse
-
#initialize(sample, path) ⇒ Sample
constructor
A new instance of Sample.
Constructor Details
#initialize(sample, path) ⇒ Sample
Returns a new instance of Sample.
11 12 13 14 15 |
# File 'lib/metro/sample.rb', line 11 def initialize(sample,path) super(sample) @sample = sample @path = path end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
9 10 11 |
# File 'lib/metro/sample.rb', line 9 def path @path end |
#sample ⇒ Object
Returns the value of attribute sample.
9 10 11 |
# File 'lib/metro/sample.rb', line 9 def sample @sample end |
Class Method Details
.create(options) ⇒ Object
Create a sample given the window and path.
24 25 26 27 28 |
# File 'lib/metro/sample.rb', line 24 def self.create() window, asset_path = create_params() gosu_sample = Gosu::Sample.new(window,asset_path.filepath) new gosu_sample, asset_path.path end |