Class: SDL2::Window::Data
- Inherits:
-
Object
- Object
- SDL2::Window::Data
- Defined in:
- lib/sdl2/window.rb
Overview
A simple wrapper for data objects associated with a window.
Instance Method Summary collapse
-
#initialize(for_window) ⇒ Data
constructor
Create a data object manager for a given window.
-
#named(name) ⇒ Object
(also: #[])
Return the data named.
-
#named=(name, value) ⇒ Object
(also: #[]=)
Set the data named to value specified.
Constructor Details
#initialize(for_window) ⇒ Data
Create a data object manager for a given window
117 118 119 |
# File 'lib/sdl2/window.rb', line 117 def initialize(for_window) @for_window = for_window end |
Instance Method Details
#named(name) ⇒ Object Also known as: []
Return the data named
122 123 124 |
# File 'lib/sdl2/window.rb', line 122 def named(name) SDL2.get_window_data(@for_window, name.to_s) end |
#named=(name, value) ⇒ Object Also known as: []=
Set the data named to value specified.
129 130 131 |
# File 'lib/sdl2/window.rb', line 129 def named=(name, value) SDL2.set_window_data(@for_window, name.to_s, value.to_s) end |