Class: DDAPI::GuildItem
- Inherits:
-
Object
- Object
- DDAPI::GuildItem
- Defined in:
- lib/dd-api/classes.rb
Overview
Represents a DRPG guild item.
Instance Attribute Summary collapse
-
#description ⇒ String
(also: #desc)
The description of the item.
-
#image ⇒ String?
The image URL to the item.
-
#level ⇒ Integer
The level of the item.
-
#name ⇒ String
The name of the item.
-
#plural ⇒ String
The plural name of the item.
-
#prefix ⇒ String
The prefix name of the item.
-
#sell_price ⇒ Integer?
The cost of the item.
Instance Method Summary collapse
-
#initialize(data, app) ⇒ Integer
constructor
attr_accessor :id.
-
#inspect ⇒ Object
The inspect method is overwritten to give more useful output.
Constructor Details
#initialize(data, app) ⇒ Integer
attr_accessor :id
263 264 265 266 267 268 269 270 271 272 273 274 |
# 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 |
Instance Attribute Details
#description ⇒ String Also known as: desc
Returns The description of the item.
251 252 253 |
# File 'lib/dd-api/classes.rb', line 251 def description @description end |
#image ⇒ String?
Returns The image URL to the item. nil if there is no image.
255 256 257 |
# File 'lib/dd-api/classes.rb', line 255 def image @image end |
#level ⇒ Integer
Returns The level of the item.
258 259 260 |
# File 'lib/dd-api/classes.rb', line 258 def level @level end |
#name ⇒ String
Returns The name of the item.
239 240 241 |
# File 'lib/dd-api/classes.rb', line 239 def name @name end |
#plural ⇒ String
Returns The plural name of the item.
248 249 250 |
# File 'lib/dd-api/classes.rb', line 248 def plural @plural end |
#prefix ⇒ String
Returns The prefix name of the item.
245 246 247 |
# File 'lib/dd-api/classes.rb', line 245 def prefix @prefix end |
#sell_price ⇒ Integer?
Returns The cost of the item. nil if not buyable.
242 243 244 |
# File 'lib/dd-api/classes.rb', line 242 def sell_price @sell_price end |
Instance Method Details
#inspect ⇒ Object
The inspect method is overwritten to give more useful output
277 278 279 |
# File 'lib/dd-api/classes.rb', line 277 def inspect "#<DDAPI::GuildItem name=#{@name} id=#{@id} level=#{@level}>" end |