Class: MatrixSdk::Bot::Base::RequestHandler
- Defined in:
- lib/matrix_sdk/bot/base.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#data ⇒ Object
Returns the value of attribute data.
-
#proc ⇒ Object
Returns the value of attribute proc.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command
9 10 11 |
# File 'lib/matrix_sdk/bot/base.rb', line 9 def command @command end |
#data ⇒ Object
Returns the value of attribute data
9 10 11 |
# File 'lib/matrix_sdk/bot/base.rb', line 9 def data @data end |
#proc ⇒ Object
Returns the value of attribute proc
9 10 11 |
# File 'lib/matrix_sdk/bot/base.rb', line 9 def proc @proc end |
#type ⇒ Object
Returns the value of attribute type
9 10 11 |
# File 'lib/matrix_sdk/bot/base.rb', line 9 def type @type end |
Instance Method Details
#arity ⇒ Object
18 19 20 21 22 |
# File 'lib/matrix_sdk/bot/base.rb', line 18 def arity arity = self.proc.parameters.count { |t, _| %i[opt req].include? t } arity = -arity if self.proc.parameters.any? { |t, _| t.to_s.include? 'rest' } arity end |
#command? ⇒ Boolean
10 11 12 |
# File 'lib/matrix_sdk/bot/base.rb', line 10 def command? type == :command end |
#event? ⇒ Boolean
14 15 16 |
# File 'lib/matrix_sdk/bot/base.rb', line 14 def event? type == :event end |