lib/wowheadr/entity/item.rb in wowheadr-0.0.4 vs lib/wowheadr/entity/item.rb in wowheadr-0.0.5

- old
+ new

@@ -1,15 +1,17 @@ require 'wowheadr/uri/rel' +require 'wowheadr/support/entity_method_mapper' module Wowheadr module Entity # Wowheadr::Entity::Item represents a +rel+ entry in an HTML link tag to # specify details about the item being linked to. A list of key/value # combinations can be found at # http://www.wowhead.com/tooltips#related-advanced-usage class Item include Wowheadr::URI::Rel + include Wowheadr::Support::EntityMethodMapper # Create a new Item and optionally pass in the ID, # which automatically calls #item on the new object. def initialize(id = nil) super() @@ -22,9 +24,10 @@ # Set the item ID for the item. Useful if the +href+ attribute of the # link does not lead to the item's URL on wowhead.com (custom URLs). def item(id) self.set(:item, id) end + alias :id :item # Set the character's level, useful for heirloom items. def level(level) self.set(:lvl, level) end