class DDAPI::GuildItem
Represents a DRPG guild item.
Attributes
desc[RW]
@return [String] The description of the item.
description[RW]
@return [String] The description of the item.
image[RW]
@return [String, nil] The image URL to the item. `nil` if there is no image.
level[RW]
@return [Integer] The level of the item.
name[RW]
@return [String] The name of the item.
plural[RW]
@return [String] The plural name of the item.
prefix[RW]
@return [String] The prefix name of the item.
sell_price[RW]
@return [Integer, nil] The cost of the item. `nil` if not buyable.
Public Class Methods
new(data, app)
click to toggle source
@return [Integer] The ID of the item. attr_accessor :id
# File lib/dd-api/classes.rb, line 263 def initialize(data, app) @data = data @name = data['name'] @level = data['level'] @description = data['desc'] @image = data['image'].nil? ? nil : API.image_url(data['image']) #@id = data['id'] @prefix = data['prefix'] @prefix = data['plural'] @cost = data['cost'] == -1 ? nil : data['cost'] @app = app end
Public Instance Methods
inspect()
click to toggle source
The inspect method is overwritten to give more useful output
# File lib/dd-api/classes.rb, line 277 def inspect "#<DDAPI::GuildItem name=#{@name} id=#{@id} level=#{@level}>" end