Module: Containers
- Defined in:
- lib/Olib/core/container.rb
Constant Summary collapse
- @@containers =
{}
Class Method Summary collapse
- .[](name) ⇒ Object
- .define(name) ⇒ Object
- .left_hand ⇒ Object
- .method_missing(name) ⇒ Object
- .right_hand ⇒ Object
Class Method Details
.[](name) ⇒ Object
251 252 253 254 255 256 257 |
# File 'lib/Olib/core/container.rb', line 251 def Containers.[](name) begin Containers.define(name) rescue Exception => e nil end end |
.define(name) ⇒ Object
240 241 242 243 244 |
# File 'lib/Olib/core/container.rb', line 240 def Containers.define(name) container = Class.new(Olib::Container) @@containers[name] = Object.const_set(name.capitalize, container).new @@containers[name] end |
.left_hand ⇒ Object
263 264 265 |
# File 'lib/Olib/core/container.rb', line 263 def Containers.left_hand Olib::Container.new(GameObj.left_hand.id) end |
.method_missing(name) ⇒ Object
246 247 248 249 |
# File 'lib/Olib/core/container.rb', line 246 def Containers.method_missing(name) return @@containers[name] if @@containers[name] return Containers.define(name) end |
.right_hand ⇒ Object
259 260 261 |
# File 'lib/Olib/core/container.rb', line 259 def Containers.right_hand Olib::Container.new(GameObj.right_hand.id) end |