SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 262 | Next

Kevin Marshall, Chad Pytel, and Jon Yurek

"Pro Active Record: Databases with Ruby and Rails"

call(self) unless blk.nil?
end
def method_missing(name, *args)
column = Column.new(name)
@columns << column
column
end
end
end
So we have a skeleton of how the code will get executed. We keep the amount (the :all or
:first that??™s normally in a find call) and the options (like :limit and :offset) stashed away
so we can get to them later, and we make an array that we can use to hold the conditions we??™re
building. Then we call the &blk block (finally) and pass in the Conditions object itself as the
parameter.
Now we know what cow was in the example when we started, and we know what will get
its method_missing called when we use the name of an attribute. What about those pesky comparisons,
though? They aren??™t arguments to the method; they??™re methods themselves. How will
we get that data into a usable form? The answer lies in the Column object being created and
returned (which you probably wondered about when you saw it??”and I??™m only telling you
about now).
Like I said, the equality symbols are actually methods on the objects, and they can be
overridden.


Pages:
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6