<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Thanks, Jon,<br>
this is practically what I asked for - a list of all of the
objects I need, and a few more. For some reason I got an error on
the last line.
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a href="https://gist.github.com/JonRowe/5158141#comment-797997">https://gist.github.com/JonRowe/5158141#comment-797997</a>
Not to worry though, with all the information I got, I'm well on
my way to a solution.<br>
Ronny.<br>
<br>
<br>
On 14/03/13 09:42, Jon Rowe wrote:<br>
</div>
<blockquote
cite="mid:C4975E7F25E74ABCA2723CD49812F114@jonrowe.co.uk"
type="cite">
<div style="font-family: Helvetica; font-size: 13px; ">
<div>You can get the constants of Object or some other top level
object, map them into the actual constants (cause Ruby returns
them as symbols),and then filter them…</div>
<div><br>
</div>
<div>Something along the lines of this… <a
moz-do-not-send="true"
href="https://gist.github.com/JonRowe/5158141">https://gist.github.com/JonRowe/5158141</a></div>
</div>
<div>
<div><br>
</div>
<div><span style="font-size: 10pt; ">Jon Rowe</span></div>
<div><span style="font-size: 10pt; ">-----------------------------</span></div>
<div><span style="font-size: 10pt; "><a class="moz-txt-link-abbreviated" href="mailto:mail@jonrowe.co.uk">mail@jonrowe.co.uk</a></span></div>
<div><span style="font-size: 10pt; ">jonrowe.co.uk</span></div>
<div><br>
</div>
</div>
<p style="color: #A0A0A8;">On Thursday, 14 March 2013 at 11:38,
Ronny Ager-Wick wrote:</p>
<blockquote type="cite"
style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
<span>
<div>
<div>
<div>I've been trying to find a way to do this, but I may
be searching for the </div>
<div>wrong terms or something because I get nowhere, even
with the help of my </div>
<div>friend Google.</div>
<div>I want to loop through the defined classes to see
which ons of them responds </div>
<div>to certain methods.</div>
<div>The classes I'm trying to find are Ohm Models that
have a certain attribute </div>
<div>defined.</div>
<div>If I had a collection of classes, I'd probably do
something like this:</div>
<div><br>
</div>
<div>classes = #get list of all classes</div>
<div>classes.each { |c|</div>
<div> # assume it's an Ohm::Model if it responds to :first</div>
<div> # maybe there's a better way of filtering out only
the Ohm models</div>
<div> if c.respond_to?(:first) &&
c.first.respond_to?(:updated_at)</div>
<div> # convert the timestamp of all records in this
model.</div>
<div> end</div>
<div>end</div>
<div><br>
</div>
<div>The end objective is to convert the timestamp from
the old way they used to </div>
<div>store it (Ohm-contrib 0.*) which looks like this
"2011-02-25 21:54:06 UTC", </div>
<div>and the new way, which are UNIX timestamps.</div>
<div>I could always just make a list of the models
manually and loop through them, </div>
<div>but I want to make a reusable script that others can
benefit from as well.</div>
<div>Ronny.</div>
<div>_______________________________________________</div>
<div>Chat mailing list</div>
<div><a moz-do-not-send="true"
href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a></div>
<div><a moz-do-not-send="true"
href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a></div>
</div>
</div>
</span> </blockquote>
<div> <br>
</div>
</blockquote>
<br>
</body>
</html>