Jack Bauer wrote:
[...]
>
> Yes, but it doesn't convert it the way I need it to. What I mean is:
>
> "FFFFFF".to_i(base=16) # => 16777215
>
> I need it to be more like this:
>
> "FFFFFF".whatever_magic_method # => 0xFFFFFF
So wrap it:
class String
def parse_hex
self.to_i 16
end
end
What's the big deal?
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---