Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
VRChat.rb_11_メタプログラミングRubyのご紹介.pdf
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
ItoJum
September 15, 2026
39
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
VRChat.rb_11_メタプログラミングRubyのご紹介.pdf
ItoJum
September 15, 2026
Transcript
15 slides
1
メタプログラミングRubyのご 紹介 VRChat.rb #11 いとじゅん
読み切ったので紹介した いよ 3
書籍 魔術書 [メタプログラミングRuby 第2版 - O'Reilly Japan]( https://www.oreilly.co.jp/books/9784873117430/ ) 4
メタプログラミングとは プログラムを生成するプログラミ ングみたいな 5
メタプログラミングとは プログラムを生成するプログラミ ングみたいな = 魔術 6
好きな魔術を紹介したい 7
オープンクラス 既存のクラスやモジュールを 再オープンして、メソッド追加・ 編集したりできる!! class String def hello "#{self}っほー!" end
end p "かぐや".hello # => かぐやっほー! 8
Module#define_method 実行時にメソッドを動的に定 義できる スコープゲートを突破できる class CPK GREETINGS = { :kaguya
=> "かぐやっほー!", :yachiyo => "ヤオヨロー!" } GREETINGS.each do |key, value| define_method("hello_#{key}") do value end end end p CPK.new.hello_kaguya # => "かぐやっほー" 9
alias_method class String alias_method :original_upcase, :upcase 既存のメソッドに別名を付ける ことができる def upcase
original_upcase + "!" end end 元の処理を退避してみた p "kaguya".upcase # => "KAGUYA!" 10
メタプロRubyの問題集 11
問題集 メタプログラミング 演習編をお手軽に できる https://github.com/kinoppyd/reading-metaprogramming-ruby 12
おわりに 13
メタプログラミングで使うの は、基本アンチパターンなの でやめとこう!!! 14
使いどころを見つけたら、 嬉々として使おう!! 15
More Decks by ItoJum
See All by ItoJum
従業員データ基盤でのパターンマッチをご紹介_Roppongi.rb スポンサーLT
itojum
0
97
DXRuby互換のPicoRuby.wasmライブラリを作っている
itojum
1
88
RubyKaigi_2026_follow_up_SmartHRスポンサーLT
itojum
0
370
サマーインターンシップのメン ターをやって得た学び5選_あつまれ!若⼿エンジニアのLT&ゆるっと交流会
itojum
0
450
SmartHRを支える従業員データ基盤とそのインフラ_Innovative Crosstalk Jamboree Geeks '26
itojum
0
540
VRChat.rbの野望.pdf
itojum
0
35
なぜtree-sitter-rubyの日本語シンボルはシンタックスハイライトされないのか
itojum
0
120
Ractorを試してみるぞ!+メタバースにおける地域.rbをやっているぜ
itojum
0
77
新卒一年目のコミュニティ駆動ライフ_新卒N年目のLT交流会.pdf
itojum
0
150
Featured
See All Featured
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
490
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.6k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
121
130k
So, you think you're a good person
axbom
PRO
2
2.3k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
First, design no harm
axbom
PRO
2
1.4k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
450
エンジニアに許された特別な時間の終わり
watany
109
250k
Paper Plane (Part 1)
katiecoart
PRO
3
12k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
680