The document discusses metaprogramming in Ruby and domain specific languages (DSLs). It provides examples of metaprogramming in programs like the Java compiler and Ruby interpreter. It also shows how DSLs are used to define languages for specific domains like musical notes or guitar chords. The presentation introduces metaprogramming and DSL implementation, including changing self, missing constants/methods, and custom operators.
Doctrine 2: Enterprise Persistence Layer for PHPJonathan Wage
Doctrine 2 is an object relational mapper (ORM) for PHP 5.3+ that sits on top of a powerful database abstraction layer (DBAL). One of its key features is the option to write database queries in a proprietary object oriented SQL dialect called Doctrine Query Language (DQL), inspired by Hibernates HQL. This provides developers with a powerful alternative to SQL that maintains flexibility without requiring unnecessary code duplication.
Extendible data model for real-time business process analysisMarcello Leida
This slides presents a promising data representation model for real time monitoring of business processes. The main benefit of this representation is that is transparent to the data creation and analysis processes and it is extensible at real-time.
The model is based on a shared vocabulary defined using RDF standard representation allowing independence between applications.
This model is a novel approach to real-time process data representation and paves the road to a complete new breed of applications for business process analysis
Slides from my talk at Greach 2014:
"Groovy is a dynamic language that provides different types of metaprogramming techniques. In this talk we’ll mainly see runtime metaprogramming. I’ll explain Groovy Meta-Object-Protocol (MOP), the metaclass, how to intercept method calls, how to deal with method missing and property missing, the use of mixins and categories. All of these topics will be explained with examples in order to understand them.
Also, I’ll talk a little bit about compile-time metaprogramming with AST Transformations. AST Transformations provide a wonderful way of manipulating code at compile time via modifications of the Abstract Syntax Tree. We’ll see a basic but powerful example of what we can do with AST transformations."
The code is available at: https://github.com/lmivan/greach2014
Web development with Lua: Introducing Sailor an MVC web framework @ CodingSer...Etiene Dalcol
Lua is a very fast and powerful scripting language that can be easily embeddable. It has been shining in industries like game development, for example. Lua is also an excellent tool as a general purpose language and can be used to develop robust applications. Its use in web developments, however, despite its great potential and incredible benchmarks, needs to be more widespread. This talk will mention the current state of Lua in web development, show some benchmarks, compare existing tools and teach how to get started with Sailor, an MVC web framework written in Lua.
Doctrine 2: Enterprise Persistence Layer for PHPJonathan Wage
Doctrine 2 is an object relational mapper (ORM) for PHP 5.3+ that sits on top of a powerful database abstraction layer (DBAL). One of its key features is the option to write database queries in a proprietary object oriented SQL dialect called Doctrine Query Language (DQL), inspired by Hibernates HQL. This provides developers with a powerful alternative to SQL that maintains flexibility without requiring unnecessary code duplication.
Extendible data model for real-time business process analysisMarcello Leida
This slides presents a promising data representation model for real time monitoring of business processes. The main benefit of this representation is that is transparent to the data creation and analysis processes and it is extensible at real-time.
The model is based on a shared vocabulary defined using RDF standard representation allowing independence between applications.
This model is a novel approach to real-time process data representation and paves the road to a complete new breed of applications for business process analysis
Slides from my talk at Greach 2014:
"Groovy is a dynamic language that provides different types of metaprogramming techniques. In this talk we’ll mainly see runtime metaprogramming. I’ll explain Groovy Meta-Object-Protocol (MOP), the metaclass, how to intercept method calls, how to deal with method missing and property missing, the use of mixins and categories. All of these topics will be explained with examples in order to understand them.
Also, I’ll talk a little bit about compile-time metaprogramming with AST Transformations. AST Transformations provide a wonderful way of manipulating code at compile time via modifications of the Abstract Syntax Tree. We’ll see a basic but powerful example of what we can do with AST transformations."
The code is available at: https://github.com/lmivan/greach2014
Web development with Lua: Introducing Sailor an MVC web framework @ CodingSer...Etiene Dalcol
Lua is a very fast and powerful scripting language that can be easily embeddable. It has been shining in industries like game development, for example. Lua is also an excellent tool as a general purpose language and can be used to develop robust applications. Its use in web developments, however, despite its great potential and incredible benchmarks, needs to be more widespread. This talk will mention the current state of Lua in web development, show some benchmarks, compare existing tools and teach how to get started with Sailor, an MVC web framework written in Lua.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Metaprogramming in Ruby
1. Introduction
DSL implementation
Summary
Metaprogramming in Ruby
Domain specific languages
Peter Vanbroekhoven
peter@xaop.com
BRUG meeting October 3 2007
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
2. Introduction
DSL implementation
Summary
Outline
Introduction
1
Metaprogramming
Ruby and Metaprogramming
DSL implementation
2
Changing self
Missing constants
Missing methods
Implementing custom operators
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
3. Introduction
DSL implementation
Summary
Outline
Introduction
1
Metaprogramming
Ruby and Metaprogramming
DSL implementation
2
Changing self
Missing constants
Missing methods
Implementing custom operators
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
4. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Outline
Introduction
1
Metaprogramming
Ruby and Metaprogramming
DSL implementation
2
Changing self
Missing constants
Missing methods
Implementing custom operators
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
5. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
What Is Metaprogramming?
Programming
your
programming
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
6. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
What Is Metaprogramming?
Metaprogramming
is a
good thing
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
7. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
The Deal With Metaprogramming
class ActiveRecord : : Base
def r e a d _ a t t r i b u t e ( attr_name )
@ a t t r i b u t e s [ attr_name ]
end
end
class MicrosoftCEO < ActiveRecord : : Base
end
b i l l = MicrosoftCEO . new
my_pocket << b i l l . r e a d _ a t t r i b u t e ( quot; money quot; )
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
8. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
The Deal With Metaprogramming
class MicrosoftCEO < ActiveRecord : : Base
def money
@ a t t r i b u t e s [ quot; money quot; ]
end
end
b i l l = MicrosoftCEO . new
my_pocket << b i l l . money
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
9. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
The Deal With Metaprogramming
class MicrosoftCEO < ActiveRecord : : Base
def money
@ a t t r i b u t e s [ quot; money quot; ]
end
def house
@ a t t r i b u t e s [ quot; house quot; ]
end
def c a r
@attributes [ quot; car quot; ]
end
end
b i l l = MicrosoftCEO . new
my_pocket << b i l l . money << b i l l . house << b i l l . c a r
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
10. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
The Deal With Metaprogramming
class MicrosoftCEO < ActiveRecord : : Base
[ quot; money quot; , quot; house quot; , quot; c a r quot; ] . each do | f |
define_method ( f ) { @ a t t r i b u t e s [ f ] }
end
end
b i l l = MicrosoftCEO . new
my_pocket << b i l l . money << b i l l . house << b i l l . c a r
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
11. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Examples of metaprogramming
Java compiler
Ruby interpreter
Firefox browser
Ruby on Rails
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
12. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Examples of metaprogramming
Java compiler
Ruby interpreter
Firefox browser
Ruby on Rails
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
13. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Examples of metaprogramming
Java compiler
Ruby interpreter
Firefox browser
Ruby on Rails
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
14. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Examples of metaprogramming
Java compiler
Ruby interpreter
Firefox browser
Ruby on Rails
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
15. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Examples of metaprogramming
Java compiler
Ruby interpreter
Firefox browser
Ruby on Rails
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
16. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Domain specific languages
def i s _ s t u f f _ c h a r ( c )
( c >= ?a && c <= ?z ) | | ( c >= ?A && c <= ?Z ) | |
( c >= ?0 && c <= ?9) | | c == ?_
end
def f i n d _ s t u f f ( s t r )
r e s u l t = [ ] ; i = 0 ; while i < s t r . l e n g t h
s t a r t = i ; i += 1 while i s _ s t u f f _ c h a r ( s t r [ i ] )
i f s t a r t ! = i && s t r [ i ] == ’@’
a t = i ; i += 1
i += 1 while i s _ s t u f f _ c h a r ( s t r [ i ] )
r e s u l t << s t r [ s t a r t . . . i ] i f a t ! = i
end ; i += 1 ; end
r e s u l t ; end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
17. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Domain specific languages
def f i n d _ e m a i l s ( s t r )
s t r . scan ( / w+@ w+ / )
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
18. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Domain specific languages
DSLs
are
everywhere
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
19. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Domain specific languages
musical notes
PP PPP
PPP
PPP
P'
DSLs
are
everywhere
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
20. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Domain specific languages
guitar chords
musical notes
PP
oo
PPP
ooo
PPP
ooo
PPP o
wooo
P'
DSLs
are
everywhere
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
21. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Domain specific languages
guitar chords
musical notes
PP
oo
PPP
ooo
PPP
ooo
PPP o
wooo
P'
DSLs
are
everywhere
7
nnn
nn
nnn
nnn
n
traffic signs
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
22. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Domain specific languages
guitar chords
musical notes
PP
oo
PPP
ooo
PPP
ooo
PPP o
wooo
P'
DSLs
are
everywhereOOO
gO
7
nnn OOO
nn
nnn OOO
nnn OO
n
Ruby
traffic signs
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
23. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Outline
Introduction
1
Metaprogramming
Ruby and Metaprogramming
DSL implementation
2
Changing self
Missing constants
Missing methods
Implementing custom operators
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
24. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Metaprogramming in Java
public P l u g i n c r e a t e _ p l u g i n ( S t r i n g name ,
S t r i n g [ ] keys , S t r i n g [ ] v a l u e s )
throws . . . {
Class c = Class . forName ( name ) ;
Class s = Class . forName ( quot; [ L j a v a . l a n g . S t r i n g ; quot; ) ;
C o n s t r u c t o r co = c . g e t C o n s t r u c t o r ( s , s ) ;
r e t u r n ( P l u g i n ) co . newInstance ( keys , v a l u e s ) ;
}
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
25. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Metaprogramming in Ruby
def c r e a t e _ p l u g i n ( name , keys , v a l u e s )
O b j e c t . c o n s t _ g e t ( name ) . new ( keys , v a l u e s )
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
26. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Comparison
Metaprogramming in Ruby
is
easy
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
27. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
Comparison
Metaprogramming in Java
is
hard
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
28. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
DSLs in Ruby
f i r s t 1 , f i r s t 2 , l a s t = ’ p e t e r ’ , ’ glenn ’ , ’ v% ’
banks = c o n n e c t i o n . execute ( quot;
SELECT b . name
FROM customer AS c , bank AS b , account AS a
WHERE ( c . f i r s t n a m e = ’ #{first1} ’ OR
c . f i r s t n a m e = ’ #{first2} ’ ) AND
c . lastname LIKE ’ #{last} ’ AND
a . owner = c . i d AND
a . bank = b . i d
quot;)
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
29. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
DSLs in Ruby : ActiveRecord
Bank . f i n d (
: all ,
: i n c l u d e => { : accounts => : customer } ,
: c o n d i t i o n s => [
quot; ( customers . f i r s t _ n a m e = ? OR
customers . f i r s t _ n a m e = ? ) AND
customers . last_name LIKE ? quot; ,
quot; first1 quot; , quot; first2 quot; , quot; last quot; ]
) . map { | b | b . name }
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
30. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
DSLs in Ruby : my own DSL
f i r s t 1 , f i r s t 2 , l a s t = ’ p e t e r ’ , ’ glenn ’ , / Av /
banks = query do
from : c => Customer , : b => Bank , : a => Account
s e l e c t b . name
where ( ( c . f i r s t n a m e == f i r s t 1 ) |
( c . f i r s t n a m e == f i r s t 2 ) ) &
( c . lastname =~ l a s t ) &
( a . owner == c ) &
( a . bank == b )
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
31. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
DSLs in Ruby : my own DSL
f i r s t 1 , f i r s t 2 , l a s t = ’ p e t e r ’ , ’ glenn ’ , / Av /
banks = query do
from : a => Account
s e l e c t a . bank . name
where ( ( a . owner . f i r s t n a m e == f i r s t 1 ) |
( a . owner . f i r s t n a m e == f i r s t 2 ) ) &
( a . owner . lastname =~ l a s t )
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
32. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
DSLs in Ruby : my own DSL
f i r s t 1 , f i r s t 2 , l a s t = ’ p e t e r ’ , ’ glenn ’ , / Av /
banks = query do
from : a => Account
c = a . owner
s e l e c t a . bank . name
where ( ( c . f i r s t n a m e == f i r s t 1 ) |
( c . f i r s t n a m e == f i r s t 2 ) ) &
( c . lastname =~ l a s t )
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
33. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
DSLs in Ruby
A Ruby DSL
is just
plain Ruby
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
34. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
DSLs in Ruby
easy to build
O OOO
OOO
OOO
O'
A Ruby DSL
is just
plain Ruby
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
35. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
DSLs in Ruby
easy to build familiar syntax
O OOO n
nnn
OOO
nnn
OOO nn
wnnn
O'
A Ruby DSL
is just
plain Ruby
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
36. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
DSLs in Ruby
easy to build familiar syntax
O OOO n
nnn
OOO
nnn
OOO nn
wnnn
O'
A Ruby DSL
is just
plain O Ruby
abstraction
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
37. Introduction
Metaprogramming
DSL implementation
Ruby and Metaprogramming
Summary
What I’ll Teach You
f i r s t 1 , f i r s t 2 , l a s t = ’ p e t e r ’ , ’ glenn ’ , / Av /
banks = query do
from : c => Customer , : b => Bank , : a => Account
s e l e c t b . name
where ( ( c . f i r s t n a m e == f i r s t 1 ) |
( c . f i r s t n a m e == f i r s t 2 ) ) &
( c . lastname =~ l a s t ) &
( a . owner == c ) &
( a . bank == b )
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
39. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
What is self?
self
is the
current object
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
40. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
What is self?
instance
variables OO
OOO
OOO
OOO
'
self
is the
current object
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
41. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
What is self?
instance dotless
variables OO methods
n
OOO n
nnn
OOO
nnn
OOO
vnnn
'
self
is the
current object
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
42. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
What is self?
instance dotless
variables OO methods
n
OOO n
nnn
OOO
nnn
OOO
vnnn
'
self
is the
current object
8
qqq
q
qqq
qqq
qq
class
variables
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
43. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
What is self?
instance dotless
variables OO methods
n
OOO n
nnn
OOO
nnn
OOO
vnnn
'
self
is the
current object
8 gOOO
qqq O OOO
q
qqq OOO
qqq O
qq changed by
class
method calls,
variables
class defs
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
44. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
What is self?
banks = query do
...
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
45. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
What is self?
banks = s e l f . query do
...
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
46. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
What is self?
# Top l e v e l
p self # => main
p s e l f . class # => O b j e c t
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
47. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
What is self?
banks = s e l f . query do
...
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
48. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
The Kernel module
Kernel
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
49. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
The Kernel module
puts O
OOO
OOO
OOO
O'
Kernel
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
50. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
The Kernel module
puts O raise
OOO qqq
OOO qqq
OOO qq
xqqq
O'
Kernel
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
51. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
The Kernel module
puts O raise
OOO qqq
OOO qqq
OOO qq
xqqq
O'
Kernel
oo7
ooo
ooo
ooo
require
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
52. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
The Kernel module
puts O raise
OOO qqq
OOO qqq
OOO qq
xqqq
O'
KernelMM
fMMM
oo7
ooo M
ooo MMM
ooo MM
require eval
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
53. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
The query method
module K e r n e l
def query
yield # C a l l the block
end
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
54. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Changing self
banks = query do
from : c => Customer , : b => Bank , : a => Account
...
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
55. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Changing self
banks = query do
s e l f . from : c => Customer , ...
...
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
56. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Changing self
banks = query do
p s e l f # => main
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
57. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Changing self
banks = query do
s e l f . from : c => Customer , ...
...
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
58. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Changing self
Sometimes
we want to
change self
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
59. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Changing self
class Query
end
module K e r n e l
def query (& b l k )
Query . new . i n s t a n c e _ e v a l (& b l k )
end
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
60. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Changing self
banks = query do
p s e l f # => #<Query : 0 xb7cc4adc >
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
61. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Changing self
instance_eval
changes self
for the duration of a block
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
62. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Changing self
class Query
def i n i t i a l i z e
@from = { }
end
def from (map)
@from = map
end
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
63. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Changing self
banks = query do
from : c => Customer , : b => Bank , : a => Account
p s e l f # => #<Query : 0 xb7cc4adc
# @from = { : b=>Bank , : a=>Account , : c=>Customer } >
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
65. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Lazy class loading
Rails
can do
lazy class loading
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
66. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Lazy class loading
test.rb
# r e q u i r e ’ brug ’
BRUG. new ( Time . now )
brug.rb
class BRUG
def i n i t i a l i z e ( t i m e )
@time = t i m e
end
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
68. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Constant lookup
BRUG.new
n = Module.nesting + [Object]
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
69. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Constant lookup
BRUG.new
n = Module.nesting + [Object]
find BRUG in n
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
70. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Constant lookup
BRUG.new
n = Module.nesting + [Object]
find BRUG in n
u
u
uu
uu
u
founduuu
uu
uu
uu
uu
zuu
return BRUG
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
71. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Constant lookup
BRUG.new
n = Module.nesting + [Object]
u KK
find BRUGKin n
u KK
uu KK
uu KK
u
founduuu KK found
not
KK
uu KK
uu KK
uu KK
uu KK
zuu %
n [0]. const_missing(:BRUG)
return BRUG
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
72. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Module.nesting
class A
module B
def m
Module . n e s t i n g # = [ A : : B , A ]
end
Module . n e s t i n g # = [ A : : B , A ]
end
end
Module . n e s t i n g # = [ ]
def A .m
Module . n e s t i n g # = [ ]
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
73. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Lazy class loading
banks = query do
from : c = Customer , : b = Bank , : a = Account
p Module . n e s t i n g + [ O b j e c t ] # = [ O b j e c t ]
...
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
74. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Lazy loading
def O b j e c t . c o n s t _ m i s s i n g ( c i d )
f i l e = f i n d _ f i l e ( cid )
require f i l e
const_get ( cid )
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
75. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Lazy class loading
def O b j e c t . c o n s t _ m i s s i n g ( c i d )
f i l e = f i n d _ f i l e ( cid )
require f i l e
i f const_defined? cid
const_get ( cid )
else
# c a l l old const_missing
end
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
76. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Lazy class loading
def O b j e c t . c o n s t _ m i s s i n g ( c i d )
f i l e = f i n d _ f i l e ( cid )
require f i l e
i f const_defined? cid
const_get ( cid )
else
# Class Module
super
end
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
77. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Lazy class loading
Lazy class loading
is
freakingly easy
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
79. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Handling b.name
banks = query do
...
s e l e c t b . name
...
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
80. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Handling b.name
banks = query do
...
s e l e c t s e l f . b . name
...
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
81. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Handling b.name
class Query
def b
...
end
end
banks = query do
...
s e l e c t s e l f . b . name
...
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
82. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Handling b.name
Can we
avoid
mass method definition
?
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
84. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Missing methods
self .b.name
ww
ww
ww
b foundwww
w
ww
ww
w
ww
{ww
self .b.name
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
85. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Missing methods
self .b.name
J JJ
ww JJ
ww JJ
ww JJ
b foundwww J
bJnot found
w JJ
ww JJ
ww JJ
w JJ
ww J$
{ww
self .method_missing(:b)
self .b.name
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
86. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Implementing Query#method_missing
banks = query do
...
p s e l f # = #Query : 0 xb7cf5dd4
s e l e c t s e l f . b . name
...
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
87. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Implementing Query#method_missing
class Query
def method_missing ( mid , ∗ args )
i f args . l e n g t h == 0 @from [m]
V a r i a b l e E x p r e s s i o n . new (m)
else
super
end
end
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
88. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Implementing Query#method_missing
class V a r i a b l e E x p r e s s i o n Expression
a t t r _ r e a d e r : varname
def i n i t i a l i z e ( varname )
@varname = varname
end
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
89. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Alternative implementation
class Query
a l i a s old_mm method_missing
def method_missing (m, ∗ args )
i f args . l e n g t h == 0 @from [m]
V a r i a b l e E x p r e s s i o n . new (m)
else
old_mm (m, ∗ args )
end
end
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
90. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Implementing Expression#method_missing
banks = query do
...
# select b
s e l e c t b . name
...
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
91. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Implementing Expression#method_missing
class Expression
def method_missing (m, ∗ args )
i f args . l e n g t h == 0
F i e l d E x p r e s s i o n . new ( s e l f , m)
else
super
end
end
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
92. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Implementing Expression#method_missing
class F i e l d E x p r e s s i o n Expression
def i n i t i a l i z e ( expression , f i e l d )
@expression , @ f i e l d = expression , f i e l d
end
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
93. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Summary
YES,
we can
avoid
mass method definition
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
95. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Oerator overloading
banks = query do
...
where ( ( c . f i r s t n a m e == f i r s t 1 ) |
( c . f i r s t n a m e == f i r s t 2 ) )
( c . lastname =~ l a s t )
( a . owner == c )
( a . bank == b )
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
96. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Operator overloading
Operators
are just
methods
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
97. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Operator overloading
banks = query do
...
where ( ( c . f i r s t n a m e . = = ( f i r s t 1 ) . | (
c . firstname .==( f i r s t 2 ) ) . (
c . lastname . = ~ ( l a s t ) . (
a . owner == c ) . ( a . bank . = = ( b ) )
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
98. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Implementing operator overloading
class Expression
def ==( o t h e r )
BinaryOpExpression . new ( s e l f , o t h e r , ’= ’ )
end
def ( o t h e r )
BinaryOpExpression . new ( s e l f , o t h e r , ’AND ’ )
end
...
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
99. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Implementing operator overloading
class BinaryOpExpression Expression
def i n i t i a l i z e ( expr1 , expr2 , op )
@expr1 , @expr2 , @op = expr1 , expr2 , op
end
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
100. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Limitations operator overloading
, ||, !
are
NOT
methods
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
101. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Summary
but ...
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
102. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Limitations operator overloading
Operator overloading
is
child’s play
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
103. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Wrapping up the example
banks = query do
...
where . . .
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
104. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Wrapping up the example
class Query
def where ( cond )
@where = cond
end
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
105. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Wrapping up the example
class Query
def t o _ s q l
quot;SELECT # { r e t u r n _ l i s t } quot;
quot;FROM # { t a b l e _ l i s t } quot;
quot;WHERE # { c o n d i t i o n _ e x p r } quot;
end
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
106. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Wrapping up the example
class Query
def t a b l e _ l i s t
@from . map { | v , t | quot; # { t } AS # { v } quot; } . j o i n ( quot; , quot; )
end
def r e t u r n _ l i s t
@select . map { | r | r . t o _ s q l } . j o i n ( quot; , quot; )
end
def c o n d i t i o n _ e x p r
@where . t o _ s q l
end
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
107. Changing self
Introduction
Missing constants
DSL implementation
Missing methods
Summary
Implementing custom operators
Wrapping up the example
f i r s t 1 , f i r s t 2 , l a s t = ’ p e t e r ’ , ’ glenn ’ , / Av /
banks = query do
from : c = Customer , : b = Bank , : a = Account
s e l e c t b . name
where ( ( c . f i r s t n a m e == f i r s t 1 ) |
( c . f i r s t n a m e == f i r s t 2 ) )
( c . lastname =~ l a s t )
( a . owner == c )
( a . bank == b )
end
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
108. Introduction
DSL implementation
Summary
Summary
Ruby has very natural metaprogramming facilities
Ruby allows building DSLs in pure Ruby
Metaporgramming made easy
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
109. Introduction
DSL implementation
Summary
Summary
Ruby has very natural metaprogramming facilities
Ruby allows building DSLs in pure Ruby
Metaporgramming made easy
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
110. Introduction
DSL implementation
Summary
Summary
Ruby has very natural metaprogramming facilities
Ruby allows building DSLs in pure Ruby
Metaporgramming made easy
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
111. Introduction
DSL implementation
Summary
Further reading
why’s (poignant) guide to Ruby
http://poignantguide.net/ruby/
http://poignantguide.net/ruby/chapter-6.html
Ruby for Rails
http://www.manning.com/black/
Programming Ruby
http://www.rubycentral.com/pickaxe/
http://www.pragmaticprogrammer.com/title/ruby/
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
112. Introduction
DSL implementation
Summary
Further reading
why’s (poignant) guide to Ruby
http://poignantguide.net/ruby/
http://poignantguide.net/ruby/chapter-6.html
Ruby for Rails
http://www.manning.com/black/
Programming Ruby
http://www.rubycentral.com/pickaxe/
http://www.pragmaticprogrammer.com/title/ruby/
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
113. Introduction
DSL implementation
Summary
Further reading
why’s (poignant) guide to Ruby
http://poignantguide.net/ruby/
http://poignantguide.net/ruby/chapter-6.html
Ruby for Rails
http://www.manning.com/black/
Programming Ruby
http://www.rubycentral.com/pickaxe/
http://www.pragmaticprogrammer.com/title/ruby/
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby
114. Introduction
DSL implementation
Summary
REAL Summary
Ruby rocks!!!
Peter Vanbroekhoven peter@xaop.com Metaprogramming in Ruby