Class: Telegem::Core::Context
- Inherits:
-
Object
- Object
- Telegem::Core::Context
- Defined in:
- lib/core/context.rb
Instance Attribute Summary collapse
-
#bot ⇒ Object
Returns the value of attribute bot.
-
#match ⇒ Object
Returns the value of attribute match.
-
#scene ⇒ Object
Returns the value of attribute scene.
-
#session ⇒ Object
Returns the value of attribute session.
-
#state ⇒ Object
Returns the value of attribute state.
-
#update ⇒ Object
Returns the value of attribute update.
Instance Method Summary collapse
- #answer_callback_query(text: nil, show_alert: false, **options) ⇒ Object
- #answer_inline_query(results, **options) ⇒ Object
- #api ⇒ Object
- #append_to_draft(draft_id = nil, content, **options) ⇒ Object
- #ask(question, **options) ⇒ Object
- #audio(audio, caption: nil, **options) ⇒ Object
- #ban_chat_member(user_id, **options) ⇒ Object
-
#business_connection_id ⇒ Object
Essential 9.6 methods for context.rb.
- #callback_query ⇒ Object
- #callback_query? ⇒ Boolean
- #cancel_draft(draft_id = nil, **options) ⇒ Object
- #caption ⇒ Object
- #caption_entities ⇒ Object
- #channel_post? ⇒ Boolean
- #chat ⇒ Object
- #command? ⇒ Boolean
- #command_args ⇒ Object
- #command_name ⇒ Object
- #copy_message(from_chat_id, message_id, **options) ⇒ Object
- #current_scene ⇒ Object
- #data ⇒ Object
- #delete_message(message_id = nil) ⇒ Object
- #document(document, caption: nil, **options) ⇒ Object
- #download_file(file_id, destination_path = nil) ⇒ Object
- #edit_date ⇒ Object
- #edit_message_reply_markup(reply_markup, **options) ⇒ Object
- #edit_message_text(text, **options) ⇒ Object
- #enter_scene(scene_name, **options) ⇒ Object
- #entities ⇒ Object
- #forward_message(from_chat_id, message_id, **options) ⇒ Object
- #from ⇒ Object
- #get_chat(**options) ⇒ Object
- #get_chat_administrators(**options) ⇒ Object
- #get_chat_members_count(**options) ⇒ Object
- #has_media? ⇒ Boolean
- #in_scene? ⇒ Boolean
-
#initialize(update, bot) ⇒ Context
constructor
A new instance of Context.
- #inline_keyboard(&block) ⇒ Object
- #inline_query ⇒ Object
- #inline_query? ⇒ Boolean
- #is_edited? ⇒ Boolean
- #keyboard(&block) ⇒ Object
- #kick_chat_member(user_id, **options) ⇒ Object
- #leave_scene(**options) ⇒ Object
- #location(latitude, longitude, **options) ⇒ Object
- #logger ⇒ Object
- #managed_bot ⇒ Object
- #media_type ⇒ Object
- #message ⇒ Object
- #message_date ⇒ Object
- #message_id ⇒ Object
- #next_step(step_name = nil) ⇒ Object
- #photo(photo, caption: nil, **options) ⇒ Object
- #pin_message(message_id, **options) ⇒ Object
- #publish_draft(draft_id = nil, **options) ⇒ Object
- #query ⇒ Object
- #raw_update ⇒ Object
- #remove_keyboard(text = nil, **options) ⇒ Object
- #replied_chat ⇒ Object
- #replied_from ⇒ Object
- #replied_message ⇒ Object
- #replied_text ⇒ Object
- #reply(text, **options) ⇒ Object
- #reply? ⇒ Boolean
- #reply_draft(text, **options) ⇒ Object
- #reply_rich(rich_message, **options) ⇒ Object
- #reply_with_inline_keyboard(text, inline_markup, **options) ⇒ Object
- #reply_with_keyboard(text, keyboard_markup, **options) ⇒ Object
- #scene_data ⇒ Object
- #send_chat_action(action, **options) ⇒ Object
-
#start_draft(initial_text = "", **options) ⇒ Object
Draft streaming support (Bot API 10.1).
- #sticker(sticker, **options) ⇒ Object
- #typing(**options) ⇒ Object
- #unban_chat_member(user_id, **options) ⇒ Object
- #unpin_message(**options) ⇒ Object
- #update_type ⇒ Object
- #uploading_audio(**options) ⇒ Object
- #uploading_document(**options) ⇒ Object
- #uploading_photo(**options) ⇒ Object
- #uploading_video(**options) ⇒ Object
- #user_id ⇒ Object
- #video(video, caption: nil, **options) ⇒ Object
- #voice(voice, caption: nil, **options) ⇒ Object
- #with_typing(&block) ⇒ Object
Constructor Details
#initialize(update, bot) ⇒ Context
Returns a new instance of Context.
8 9 10 11 12 13 14 15 |
# File 'lib/core/context.rb', line 8 def initialize(update, bot) @update = update @bot = bot @state = {} @session = {} @match = nil @scene = nil end |
Instance Attribute Details
#bot ⇒ Object
Returns the value of attribute bot.
6 7 8 |
# File 'lib/core/context.rb', line 6 def bot @bot end |
#match ⇒ Object
Returns the value of attribute match.
6 7 8 |
# File 'lib/core/context.rb', line 6 def match @match end |
#scene ⇒ Object
Returns the value of attribute scene.
6 7 8 |
# File 'lib/core/context.rb', line 6 def scene @scene end |
#session ⇒ Object
Returns the value of attribute session.
6 7 8 |
# File 'lib/core/context.rb', line 6 def session @session end |
#state ⇒ Object
Returns the value of attribute state.
6 7 8 |
# File 'lib/core/context.rb', line 6 def state @state end |
#update ⇒ Object
Returns the value of attribute update.
6 7 8 |
# File 'lib/core/context.rb', line 6 def update @update end |
Instance Method Details
#answer_callback_query(text: nil, show_alert: false, **options) ⇒ Object
203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/core/context.rb', line 203 def answer_callback_query(text: nil, show_alert: false, **) return nil unless callback_query params = { callback_query_id: callback_query.id, show_alert: show_alert }.merge() params[:text] = text if text @bot.api.call('answerCallbackQuery', params) end |
#answer_inline_query(results, **options) ⇒ Object
215 216 217 218 219 220 221 222 223 224 |
# File 'lib/core/context.rb', line 215 def answer_inline_query(results, **) return nil unless inline_query params = { inline_query_id: inline_query.id, results: results.to_json }.merge() @bot.api.call('answerInlineQuery', params) end |
#api ⇒ Object
537 538 539 |
# File 'lib/core/context.rb', line 537 def api @bot.api end |
#append_to_draft(draft_id = nil, content, **options) ⇒ Object
149 150 151 152 153 154 155 156 157 158 |
# File 'lib/core/context.rb', line 149 def append_to_draft(draft_id = nil, content, **) return nil unless chat draft_id ||= session[:telegem_draft_id] return nil unless draft_id = { blocks: [{ type: "paragraph", content: content }] } params = { chat_id: chat.id, draft_id: draft_id, rich_message: }.merge() @bot.api.call('sendRichMessageDraft', params) end |
#ask(question, **options) ⇒ Object
460 461 462 463 464 465 466 467 |
# File 'lib/core/context.rb', line 460 def ask(question, **) scene_data = session[:telegem_scene] if scene_data scene_data[:waiting_for_response] = true scene_data[:last_question] = question end reply(question, **) end |
#audio(audio, caption: nil, **options) ⇒ Object
250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/core/context.rb', line 250 def audio(audio, caption: nil, **) return nil unless chat params = { chat_id: chat.id, caption: caption }.merge() if file_object?(audio) @bot.api.upload('sendAudio', params.merge(audio: audio)) else @bot.api.call('sendAudio', params.merge(audio: audio)) end end |
#ban_chat_member(user_id, **options) ⇒ Object
361 362 363 364 365 366 |
# File 'lib/core/context.rb', line 361 def ban_chat_member(user_id, **) return nil unless chat params = { chat_id: chat.id, user_id: user_id }.merge() @bot.api.call('banChatMember', params) end |
#business_connection_id ⇒ Object
Essential 9.6 methods for context.rb
516 517 518 |
# File 'lib/core/context.rb', line 516 def business_connection_id &.business_connection_id || @update.business_connection_id end |
#callback_query ⇒ Object
21 22 23 |
# File 'lib/core/context.rb', line 21 def callback_query @update.callback_query end |
#callback_query? ⇒ Boolean
113 114 115 |
# File 'lib/core/context.rb', line 113 def callback_query? update_type == :callback_query end |
#cancel_draft(draft_id = nil, **options) ⇒ Object
172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/core/context.rb', line 172 def cancel_draft(draft_id = nil, **) return nil unless chat draft_id ||= session[:telegem_draft_id] return nil unless draft_id params = { chat_id: chat.id, draft_id: draft_id }.merge() result = @bot.api.call('cancelRichMessageDraft', params) session.delete(:telegem_draft_id) result end |
#caption ⇒ Object
77 78 79 |
# File 'lib/core/context.rb', line 77 def caption &.caption end |
#caption_entities ⇒ Object
73 74 75 |
# File 'lib/core/context.rb', line 73 def caption_entities &.caption_entities || [] end |
#channel_post? ⇒ Boolean
109 110 111 |
# File 'lib/core/context.rb', line 109 def channel_post? update_type == :channel_post end |
#chat ⇒ Object
33 34 35 |
# File 'lib/core/context.rb', line 33 def chat &.chat || callback_query&.&.chat end |
#command? ⇒ Boolean
499 500 501 |
# File 'lib/core/context.rb', line 499 def command? &.command? || false end |
#command_args ⇒ Object
503 504 505 |
# File 'lib/core/context.rb', line 503 def command_args &.command_args if command? end |
#command_name ⇒ Object
57 58 59 |
# File 'lib/core/context.rb', line 57 def command_name &.command_name end |
#copy_message(from_chat_id, message_id, **options) ⇒ Object
328 329 330 331 332 333 334 335 336 337 338 |
# File 'lib/core/context.rb', line 328 def (from_chat_id, , **) return nil unless chat params = { chat_id: chat.id, from_chat_id: from_chat_id, message_id: }.merge() @bot.api.call('copyMessage', params) end |
#current_scene ⇒ Object
471 472 473 |
# File 'lib/core/context.rb', line 471 def current_scene @session[:telegem_scene]&.[](:id) end |
#data ⇒ Object
37 38 39 |
# File 'lib/core/context.rb', line 37 def data callback_query&.data end |
#delete_message(message_id = nil) ⇒ Object
196 197 198 199 200 201 |
# File 'lib/core/context.rb', line 196 def ( = nil) mid = || &. return nil unless mid && chat @bot.api.call('deleteMessage', chat_id: chat.id, message_id: mid) end |
#document(document, caption: nil, **options) ⇒ Object
238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/core/context.rb', line 238 def document(document, caption: nil, **) return nil unless chat params = { chat_id: chat.id, caption: caption }.merge() if file_object?(document) @bot.api.upload('sendDocument', params.merge(document: document)) else @bot.api.call('sendDocument', params.merge(document: document)) end end |
#download_file(file_id, destination_path = nil) ⇒ Object
286 287 288 |
# File 'lib/core/context.rb', line 286 def download_file(file_id, destination_path = nil) @bot.api.download(file_id, destination_path) end |
#edit_date ⇒ Object
53 54 55 |
# File 'lib/core/context.rb', line 53 def edit_date &.edit_date end |
#edit_message_reply_markup(reply_markup, **options) ⇒ Object
429 430 431 432 433 434 435 436 437 438 439 |
# File 'lib/core/context.rb', line 429 def (reply_markup, **) return nil unless && chat params = { chat_id: chat.id, message_id: ., reply_markup: reply_markup }.merge() @bot.api.call('editMessageReplyMarkup', params) end |
#edit_message_text(text, **options) ⇒ Object
184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/core/context.rb', line 184 def (text, **) return nil unless && chat params = { chat_id: chat.id, message_id: ., text: text }.merge() @bot.api.call('editMessageText', params) end |
#enter_scene(scene_name, **options) ⇒ Object
507 508 509 510 511 512 513 |
# File 'lib/core/context.rb', line 507 def enter_scene(scene_name, **) scene = @bot.scenes[scene_name] return nil unless scene leave_scene if in_scene? scene.enter(self, [:step], .except(:step)) scene_name end |
#entities ⇒ Object
69 70 71 |
# File 'lib/core/context.rb', line 69 def entities &.entities || [] end |
#forward_message(from_chat_id, message_id, **options) ⇒ Object
316 317 318 319 320 321 322 323 324 325 326 |
# File 'lib/core/context.rb', line 316 def (from_chat_id, , **) return nil unless chat params = { chat_id: chat.id, from_chat_id: from_chat_id, message_id: }.merge() @bot.api.call('forwardMessage', params) end |
#from ⇒ Object
29 30 31 |
# File 'lib/core/context.rb', line 29 def from &.from || callback_query&.from || inline_query&.from end |
#get_chat(**options) ⇒ Object
389 390 391 392 393 394 |
# File 'lib/core/context.rb', line 389 def get_chat(**) return nil unless chat params = { chat_id: chat.id }.merge() @bot.api.call('getChat', params) end |
#get_chat_administrators(**options) ⇒ Object
375 376 377 378 379 380 |
# File 'lib/core/context.rb', line 375 def get_chat_administrators(**) return nil unless chat params = { chat_id: chat.id }.merge() @bot.api.call('getChatAdministrators', params) end |
#get_chat_members_count(**options) ⇒ Object
382 383 384 385 386 387 |
# File 'lib/core/context.rb', line 382 def get_chat_members_count(**) return nil unless chat params = { chat_id: chat.id }.merge() @bot.api.call('getChatMembersCount', params) end |
#has_media? ⇒ Boolean
61 62 63 |
# File 'lib/core/context.rb', line 61 def has_media? &.has_media? || false end |
#in_scene? ⇒ Boolean
474 475 476 |
# File 'lib/core/context.rb', line 474 def in_scene? !current_scene.nil? end |
#inline_keyboard(&block) ⇒ Object
400 401 402 |
# File 'lib/core/context.rb', line 400 def inline_keyboard(&block) Telegem::Markup.inline(&block) end |
#inline_query ⇒ Object
25 26 27 |
# File 'lib/core/context.rb', line 25 def inline_query @update.inline_query end |
#inline_query? ⇒ Boolean
117 118 119 |
# File 'lib/core/context.rb', line 117 def inline_query? update_type == :inline_query end |
#is_edited? ⇒ Boolean
105 106 107 |
# File 'lib/core/context.rb', line 105 def is_edited? !!@update. end |
#keyboard(&block) ⇒ Object
396 397 398 |
# File 'lib/core/context.rb', line 396 def keyboard(&block) Telegem::Markup.keyboard(&block) end |
#kick_chat_member(user_id, **options) ⇒ Object
354 355 356 357 358 359 |
# File 'lib/core/context.rb', line 354 def kick_chat_member(user_id, **) return nil unless chat params = { chat_id: chat.id, user_id: user_id }.merge() @bot.api.call('kickChatMember', params) end |
#leave_scene(**options) ⇒ Object
477 478 479 480 481 482 483 484 485 486 |
# File 'lib/core/context.rb', line 477 def leave_scene(**) scene_data = @session[:telegem_scene] return unless scene_data scene_id = scene_data[:id].to_sym scene = @bot.scenes[scene_id] result = scene&.leave(self, [:reason] || :manual) @session.delete(:telegem_scene) @scene = nil result end |
#location(latitude, longitude, **options) ⇒ Object
297 298 299 300 301 302 303 304 305 306 307 |
# File 'lib/core/context.rb', line 297 def location(latitude, longitude, **) return nil unless chat params = { chat_id: chat.id, latitude: latitude, longitude: longitude }.merge() @bot.api.call('sendLocation', params) end |
#logger ⇒ Object
529 530 531 |
# File 'lib/core/context.rb', line 529 def logger @bot.logger end |
#managed_bot ⇒ Object
525 526 527 |
# File 'lib/core/context.rb', line 525 def managed_bot @update.managed_bot end |
#media_type ⇒ Object
65 66 67 |
# File 'lib/core/context.rb', line 65 def media_type &.media_type end |
#message ⇒ Object
17 18 19 |
# File 'lib/core/context.rb', line 17 def @update. end |
#message_date ⇒ Object
49 50 51 |
# File 'lib/core/context.rb', line 49 def &.date end |
#message_id ⇒ Object
45 46 47 |
# File 'lib/core/context.rb', line 45 def &. end |
#next_step(step_name = nil) ⇒ Object
487 488 489 490 491 492 493 |
# File 'lib/core/context.rb', line 487 def next_step(step_name = nil) scene_data = @session[:telegem_scene] return unless scene_data scene_id = scene_data[:id].to_sym scene = @bot.scenes[scene_id] scene&.next_step(self, step_name) end |
#photo(photo, caption: nil, **options) ⇒ Object
226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/core/context.rb', line 226 def photo(photo, caption: nil, **) return nil unless chat params = { chat_id: chat.id, caption: caption }.merge() if file_object?(photo) @bot.api.upload('sendPhoto', params.merge(photo: photo)) else @bot.api.call('sendPhoto', params.merge(photo: photo)) end end |
#pin_message(message_id, **options) ⇒ Object
340 341 342 343 344 345 |
# File 'lib/core/context.rb', line 340 def (, **) return nil unless chat params = { chat_id: chat.id, message_id: }.merge() @bot.api.call('pinChatMessage', params) end |
#publish_draft(draft_id = nil, **options) ⇒ Object
160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/core/context.rb', line 160 def publish_draft(draft_id = nil, **) return nil unless chat draft_id ||= session[:telegem_draft_id] return nil unless draft_id params = { chat_id: chat.id, draft_id: draft_id }.merge() result = @bot.api.call('publishRichMessageDraft', params) session.delete(:telegem_draft_id) result end |
#query ⇒ Object
41 42 43 |
# File 'lib/core/context.rb', line 41 def query inline_query&.query end |
#raw_update ⇒ Object
533 534 535 |
# File 'lib/core/context.rb', line 533 def raw_update @update._raw_data end |
#remove_keyboard(text = nil, **options) ⇒ Object
418 419 420 421 422 423 424 425 426 427 |
# File 'lib/core/context.rb', line 418 def remove_keyboard(text = nil, **) return nil unless chat reply_markup = Telegem::Markup.remove(**.slice(:selective)) if text reply(text, reply_markup: reply_markup, **.except(:selective)) else reply_markup end end |
#replied_chat ⇒ Object
97 98 99 |
# File 'lib/core/context.rb', line 97 def replied_chat &.chat end |
#replied_from ⇒ Object
93 94 95 |
# File 'lib/core/context.rb', line 93 def replied_from &.from end |
#replied_message ⇒ Object
85 86 87 |
# File 'lib/core/context.rb', line 85 def &. end |
#replied_text ⇒ Object
89 90 91 |
# File 'lib/core/context.rb', line 89 def replied_text &.text end |
#reply(text, **options) ⇒ Object
121 122 123 124 125 126 |
# File 'lib/core/context.rb', line 121 def reply(text, **) return nil unless chat params = { chat_id: chat.id, text: text }.merge() @bot.api.call('sendMessage', params) end |
#reply? ⇒ Boolean
81 82 83 |
# File 'lib/core/context.rb', line 81 def reply? &.reply? end |
#reply_draft(text, **options) ⇒ Object
520 521 522 523 |
# File 'lib/core/context.rb', line 520 def reply_draft(text, **) return unless chat @bot.api.call('sendMessageDraft', { chat_id: chat.id, text: text }.merge()) end |
#reply_rich(rich_message, **options) ⇒ Object
128 129 130 131 132 133 |
# File 'lib/core/context.rb', line 128 def reply_rich(, **) return nil unless chat params = { chat_id: chat.id, rich_message: }.merge() @bot.api.call('sendRichMessage', params) end |
#reply_with_inline_keyboard(text, inline_markup, **options) ⇒ Object
411 412 413 414 415 416 |
# File 'lib/core/context.rb', line 411 def reply_with_inline_keyboard(text, inline_markup, **) return nil unless chat reply_markup = inline_markup.is_a?(Hash) ? inline_markup : inline_markup.to_h reply(text, reply_markup: reply_markup, **) end |
#reply_with_keyboard(text, keyboard_markup, **options) ⇒ Object
404 405 406 407 408 409 |
# File 'lib/core/context.rb', line 404 def reply_with_keyboard(text, keyboard_markup, **) return nil unless chat reply_markup = keyboard_markup.is_a?(Hash) ? keyboard_markup : keyboard_markup.to_h reply(text, reply_markup: reply_markup, **) end |
#scene_data ⇒ Object
468 469 470 |
# File 'lib/core/context.rb', line 468 def scene_data @session[:telegem_scene]&.[](:data) || {} end |
#send_chat_action(action, **options) ⇒ Object
309 310 311 312 313 314 |
# File 'lib/core/context.rb', line 309 def send_chat_action(action, **) return nil unless chat params = { chat_id: chat.id, action: action }.merge() @bot.api.call('sendChatAction', params) end |
#start_draft(initial_text = "", **options) ⇒ Object
Draft streaming support (Bot API 10.1)
136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/core/context.rb', line 136 def start_draft(initial_text = "", **) return nil unless chat draft_id = "draft_#{chat.id}_#{Time.now.to_i}_#{rand(1000)}" session[:telegem_draft_id] = draft_id = { blocks: [{ type: "paragraph", content: initial_text }] } params = { chat_id: chat.id, draft_id: draft_id, rich_message: }.merge() @bot.api.call('sendRichMessageDraft', params) draft_id end |
#sticker(sticker, **options) ⇒ Object
290 291 292 293 294 295 |
# File 'lib/core/context.rb', line 290 def sticker(sticker, **) return nil unless chat params = { chat_id: chat.id, sticker: sticker }.merge() @bot.api.call('sendSticker', params) end |
#typing(**options) ⇒ Object
441 442 443 |
# File 'lib/core/context.rb', line 441 def typing(**) send_chat_action('typing', **) end |
#unban_chat_member(user_id, **options) ⇒ Object
368 369 370 371 372 373 |
# File 'lib/core/context.rb', line 368 def unban_chat_member(user_id, **) return nil unless chat params = { chat_id: chat.id, user_id: user_id }.merge() @bot.api.call('unbanChatMember', params) end |
#unpin_message(**options) ⇒ Object
347 348 349 350 351 352 |
# File 'lib/core/context.rb', line 347 def (**) return nil unless chat params = { chat_id: chat.id }.merge() @bot.api.call('unpinChatMessage', params) end |
#update_type ⇒ Object
101 102 103 |
# File 'lib/core/context.rb', line 101 def update_type @update.type end |
#uploading_audio(**options) ⇒ Object
453 454 455 |
# File 'lib/core/context.rb', line 453 def uploading_audio(**) send_chat_action('upload_audio', **) end |
#uploading_document(**options) ⇒ Object
457 458 459 |
# File 'lib/core/context.rb', line 457 def uploading_document(**) send_chat_action('upload_document', **) end |
#uploading_photo(**options) ⇒ Object
445 446 447 |
# File 'lib/core/context.rb', line 445 def uploading_photo(**) send_chat_action('upload_photo', **) end |
#uploading_video(**options) ⇒ Object
449 450 451 |
# File 'lib/core/context.rb', line 449 def uploading_video(**) send_chat_action('upload_video', **) end |
#user_id ⇒ Object
541 542 543 |
# File 'lib/core/context.rb', line 541 def user_id from&.id end |
#video(video, caption: nil, **options) ⇒ Object
262 263 264 265 266 267 268 269 270 271 272 |
# File 'lib/core/context.rb', line 262 def video(video, caption: nil, **) return nil unless chat params = { chat_id: chat.id, caption: caption }.merge() if file_object?(video) @bot.api.upload('sendVideo', params.merge(video: video)) else @bot.api.call('sendVideo', params.merge(video: video)) end end |
#voice(voice, caption: nil, **options) ⇒ Object
274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/core/context.rb', line 274 def voice(voice, caption: nil, **) return nil unless chat params = { chat_id: chat.id, caption: caption }.merge() if file_object?(voice) @bot.api.upload('sendVoice', params.merge(voice: voice)) else @bot.api.call('sendVoice', params.merge(voice: voice)) end end |
#with_typing(&block) ⇒ Object
494 495 496 497 |
# File 'lib/core/context.rb', line 494 def with_typing(&block) typing block.call end |