Class: Rubirai::Group
- Inherits:
-
Object
- Object
- Rubirai::Group
- Defined in:
- lib/rubirai/objects/group.rb
Overview
The group
Defined Under Namespace
Classes: Permission
Instance Attribute Summary collapse
-
#bot ⇒ Bot
readonly
The bot.
-
#id ⇒ Integer
readonly
Group id.
-
#name ⇒ String
readonly
Group name.
-
#permission ⇒ String
readonly
The group permission of the bot.
Instance Method Summary collapse
-
#initialize(hash, bot = nil) ⇒ Group
constructor
A new instance of Group.
Constructor Details
#initialize(hash, bot = nil) ⇒ Group
Returns a new instance of Group.
19 20 21 22 23 24 25 |
# File 'lib/rubirai/objects/group.rb', line 19 def initialize(hash, bot = nil) hash = hash.stringify_keys @bot = bot @id = hash['id'] @name = hash['name'] @permission = hash['permission'] end |
Instance Attribute Details
#bot ⇒ Bot (readonly)
Returns the bot.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/rubirai/objects/group.rb', line 14 class Group attr_reader :bot, :id, :name, :permission # @param hash [Hash{String => Object}] # @param bot [Rubirai::Bot, nil] def initialize(hash, bot = nil) hash = hash.stringify_keys @bot = bot @id = hash['id'] @name = hash['name'] @permission = hash['permission'] end # Group permissions class Permission # Owner OWNER = 'OWNER' # Administrator ADMINISTRATOR = 'ADMINISTRATOR' # Member MEMBER = 'MEMBER' end end |
#id ⇒ Integer (readonly)
Returns group id.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/rubirai/objects/group.rb', line 14 class Group attr_reader :bot, :id, :name, :permission # @param hash [Hash{String => Object}] # @param bot [Rubirai::Bot, nil] def initialize(hash, bot = nil) hash = hash.stringify_keys @bot = bot @id = hash['id'] @name = hash['name'] @permission = hash['permission'] end # Group permissions class Permission # Owner OWNER = 'OWNER' # Administrator ADMINISTRATOR = 'ADMINISTRATOR' # Member MEMBER = 'MEMBER' end end |
#name ⇒ String (readonly)
Returns group name.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/rubirai/objects/group.rb', line 14 class Group attr_reader :bot, :id, :name, :permission # @param hash [Hash{String => Object}] # @param bot [Rubirai::Bot, nil] def initialize(hash, bot = nil) hash = hash.stringify_keys @bot = bot @id = hash['id'] @name = hash['name'] @permission = hash['permission'] end # Group permissions class Permission # Owner OWNER = 'OWNER' # Administrator ADMINISTRATOR = 'ADMINISTRATOR' # Member MEMBER = 'MEMBER' end end |
#permission ⇒ String (readonly)
Returns the group permission of the bot. See Permission.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/rubirai/objects/group.rb', line 14 class Group attr_reader :bot, :id, :name, :permission # @param hash [Hash{String => Object}] # @param bot [Rubirai::Bot, nil] def initialize(hash, bot = nil) hash = hash.stringify_keys @bot = bot @id = hash['id'] @name = hash['name'] @permission = hash['permission'] end # Group permissions class Permission # Owner OWNER = 'OWNER' # Administrator ADMINISTRATOR = 'ADMINISTRATOR' # Member MEMBER = 'MEMBER' end end |