Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
a simple example of method_missing and why you should use it with care
class Item
attr_reader :id
def initialize(id, properties)
@id = id
@properties = properties
def method_missing(m, *args, &block)
end, {:name => "car", :color => "red"})
p i.color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment