Class: ActiveMatrix::Bot::Base::RequestHandler
- Inherits:
-
Struct
- Object
- Struct
- ActiveMatrix::Bot::Base::RequestHandler
- Defined in:
- lib/active_matrix/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
10 11 12 |
# File 'lib/active_matrix/bot/base.rb', line 10 def command @command end |
#data ⇒ Object
Returns the value of attribute data
10 11 12 |
# File 'lib/active_matrix/bot/base.rb', line 10 def data @data end |
#proc ⇒ Object
Returns the value of attribute proc
10 11 12 |
# File 'lib/active_matrix/bot/base.rb', line 10 def proc @proc end |
#type ⇒ Object
Returns the value of attribute type
10 11 12 |
# File 'lib/active_matrix/bot/base.rb', line 10 def type @type end |
Instance Method Details
#arity ⇒ Object
19 20 21 22 23 |
# File 'lib/active_matrix/bot/base.rb', line 19 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
11 12 13 |
# File 'lib/active_matrix/bot/base.rb', line 11 def command? type == :command end |
#event? ⇒ Boolean
15 16 17 |
# File 'lib/active_matrix/bot/base.rb', line 15 def event? type == :event end |