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
258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/dd-api/classes.rb', line 258 def initialize(data, app) @data = data @name = data['name'] @level = data['level'] @description = data['desc'] @image = 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.
246 247 248 |
# File 'lib/dd-api/classes.rb', line 246 def description @description end |
#image ⇒ String
Returns The image URL to the item.
250 251 252 |
# File 'lib/dd-api/classes.rb', line 250 def image @image end |
#level ⇒ Integer
Returns The level of the item.
253 254 255 |
# File 'lib/dd-api/classes.rb', line 253 def level @level end |
#name ⇒ String
Returns The name of the item.
234 235 236 |
# File 'lib/dd-api/classes.rb', line 234 def name @name end |
#plural ⇒ String
Returns The plural name of the item.
243 244 245 |
# File 'lib/dd-api/classes.rb', line 243 def plural @plural end |
#prefix ⇒ String
Returns The prefix name of the item.
240 241 242 |
# File 'lib/dd-api/classes.rb', line 240 def prefix @prefix end |
#sell_price ⇒ Integer?
Returns The cost of the item. nil if not buyable.
237 238 239 |
# File 'lib/dd-api/classes.rb', line 237 def sell_price @sell_price end |
Instance Method Details
#inspect ⇒ Object
The inspect method is overwritten to give more useful output
272 273 274 |
# File 'lib/dd-api/classes.rb', line 272 def inspect "#<DDAPI::GuildItem name=#{@name} id=#{@id} level=#{@level}>" end |