Class: Wowr::Classes::FullItem
Overview
Full data from item-info and item-tooltip
Instance Attribute Summary
Attributes inherited from Item
Instance Method Summary collapse
-
#initialize(info, tooltip, api = nil) ⇒ FullItem
constructor
A new instance of FullItem.
- #method_missing(m, *args) ⇒ Object
Methods inherited from Item
Constructor Details
#initialize(info, tooltip, api = nil) ⇒ FullItem
Returns a new instance of FullItem.
56 57 58 59 60 |
# File 'lib/wowr/item.rb', line 56 def initialize(info, tooltip, api = nil) super(info, api) @info = ItemInfo.new(info, api) @tooltip = ItemTooltip.new(tooltip, api) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/wowr/item.rb', line 62 def method_missing(m, *args) begin return @info.send(m, *args) rescue NoMethodError => e begin return @tooltip.send(m, *args) rescue raise NoMethodError.new("undefined method '#{m}' for #{self.class}") end end end |