Class: TeBot::Cable
- Inherits:
-
Object
- Object
- TeBot::Cable
- Defined in:
- lib/te_bot/cable.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #chat_id ⇒ Object
-
#initialize(wire, message, params = {}) ⇒ Cable
constructor
A new instance of Cable.
- #reply(**payload) ⇒ Object
Constructor Details
#initialize(wire, message, params = {}) ⇒ Cable
Returns a new instance of Cable.
6 7 8 9 10 |
# File 'lib/te_bot/cable.rb', line 6 def initialize(wire, , params = {}) @wire = wire = @params = params end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/te_bot/cable.rb', line 5 def end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
5 6 7 |
# File 'lib/te_bot/cable.rb', line 5 def params @params end |
Instance Method Details
#chat_id ⇒ Object
12 13 14 |
# File 'lib/te_bot/cable.rb', line 12 def chat_id .data&.chat_id end |
#reply(**payload) ⇒ Object
16 17 18 19 20 |
# File 'lib/te_bot/cable.rb', line 16 def reply(**payload) return if chat_id.nil? @wire. chat_id, **payload end |