Module: ESM::Command::Base::Definition
- Extended by:
- ActiveSupport::Concern
- Included in:
- ESM::Command::Base
- Defined in:
- lib/esm/command/base/definition.rb
Overview
Methods involved with defining or creating a Command for ESM
Defined Under Namespace
Classes: Attribute
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#cooldown_time ⇒ Object
readonly
Returns the value of attribute cooldown_time.
-
#current_channel ⇒ Object
Returns the value of attribute current_channel.
-
#current_community ⇒ Object
Returns the value of attribute current_community.
-
#current_user ⇒ Object
Returns the value of attribute current_user.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#permissions ⇒ Object
readonly
Returns the value of attribute permissions.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#timers ⇒ Object
readonly
Returns the value of attribute timers.
Instance Method Summary collapse
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
323 324 325 |
# File 'lib/esm/command/base/definition.rb', line 323 def category @category end |
#cooldown_time ⇒ Object (readonly)
Returns the value of attribute cooldown_time.
323 324 325 |
# File 'lib/esm/command/base/definition.rb', line 323 def cooldown_time @cooldown_time end |
#current_channel ⇒ Object
Returns the value of attribute current_channel.
325 326 327 |
# File 'lib/esm/command/base/definition.rb', line 325 def current_channel @current_channel end |
#current_community ⇒ Object
Returns the value of attribute current_community.
325 326 327 |
# File 'lib/esm/command/base/definition.rb', line 325 def current_community @current_community end |
#current_user ⇒ Object
Returns the value of attribute current_user.
325 326 327 |
# File 'lib/esm/command/base/definition.rb', line 325 def current_user @current_user end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
323 324 325 |
# File 'lib/esm/command/base/definition.rb', line 323 def event @event end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
323 324 325 |
# File 'lib/esm/command/base/definition.rb', line 323 def name @name end |
#permissions ⇒ Object (readonly)
Returns the value of attribute permissions.
323 324 325 |
# File 'lib/esm/command/base/definition.rb', line 323 def @permissions end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
322 323 324 |
# File 'lib/esm/command/base/definition.rb', line 322 def response @response end |
#timers ⇒ Object (readonly)
Returns the value of attribute timers.
323 324 325 |
# File 'lib/esm/command/base/definition.rb', line 323 def timers @timers end |
Instance Method Details
#initialize(user: nil, server: nil, channel: nil, arguments: {}) ⇒ Object
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 |
# File 'lib/esm/command/base/definition.rb', line 329 def initialize(user: nil, server: nil, channel: nil, arguments: {}) command_class = self.class # These can be modified on the fly. Disconnect them from the class self.skipped_actions = skipped_actions.dup self.requirements = requirements.dup @name = command_class.command_name @category = command_class.category @attributes = attributes.to_istruct @current_user = ESM::User.from_discord(user) @current_community = ESM::Community.from_discord(server) @current_channel = channel @arguments = ESM::Command::Arguments.new( self, templates: command_class.arguments, values: arguments ) @timers = Timers.new(name) end |