Class: DDAPI::Guild
- Inherits:
-
Object
- Object
- DDAPI::Guild
- Defined in:
- lib/dd-api/classes.rb
Overview
Represents a DRPG guild.
Instance Attribute Summary collapse
-
#description ⇒ String
(also: #desc)
The description of the guild.
-
#gold ⇒ Integer
The amount gold in the guild.
-
#icon ⇒ true, false
The icon of the guild.
-
#id ⇒ Integer
The ID of the guild.
-
#level ⇒ Integer
(also: #lvl)
The level of the guild.
-
#name ⇒ String
The name of the guild.
-
#owner ⇒ User
(also: #leader)
The user object of the guild owner.
Instance Method Summary collapse
-
#initialize(data, app) ⇒ Guild
constructor
A new instance of Guild.
-
#inspect ⇒ Object
The inspect method is overwritten to give more useful output.
Constructor Details
#initialize(data, app) ⇒ Guild
120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/dd-api/classes.rb', line 120 def initialize(data, app) @data = data @gdata = data['guild'] @name = data['name'] @level = gdata['level'] @description = gdata['desc'] @gold = gdata['gold'] @icon = HTMLEntities.new.decode(gdata['icon']) @id = data['id'] @members = gdata['members'] @owner = @app.user(gdata['owner']) @app = app end |
Instance Attribute Details
#description ⇒ String Also known as: desc
104 105 106 |
# File 'lib/dd-api/classes.rb', line 104 def description @description end |
#gold ⇒ Integer
108 109 110 |
# File 'lib/dd-api/classes.rb', line 108 def gold @gold end |
#icon ⇒ true, false
118 119 120 |
# File 'lib/dd-api/classes.rb', line 118 def icon @icon end |
#id ⇒ Integer
115 116 117 |
# File 'lib/dd-api/classes.rb', line 115 def id @id end |
#level ⇒ Integer Also known as: lvl
111 112 113 |
# File 'lib/dd-api/classes.rb', line 111 def level @level end |
#name ⇒ String
97 98 99 |
# File 'lib/dd-api/classes.rb', line 97 def name @name end |
#owner ⇒ User Also known as: leader
100 101 102 |
# File 'lib/dd-api/classes.rb', line 100 def owner @owner end |
Instance Method Details
#inspect ⇒ Object
The inspect method is overwritten to give more useful output
135 136 137 |
# File 'lib/dd-api/classes.rb', line 135 def inspect "#<DDAPI::Guild name=#{@name} id=#{@id} level=#{@level}>" end |