[
Note: The following has just been fixed in the latest version, 0.7.3]
I wasn't able to find anything about this in the documentation nor on the forum however after extensive Googling I came to a solution so I figured in the interests of all members I would post it to the forum so maybe the solution will be easier to find.
It appears that the Ruby Binding for the Linode API has a bug with ruby 1.8.7. Those using ruby 1.8.7 will not be able to read any data record with the name "type".
For example domain.resource.list returns a list of dns records as object type OpenStruct. One of the sub-records returned for each dns record is "type", however ruby 1.8.7 cannot read the value.
Trying to do so:
puts record.type
Results in the following error:
Code:
openstruct warning: Object#type is deprecated; use Object#class
There are two solutions to this problem; 1) Upgrade to ruby 1.9, it appears OpenStruct doesn't suffer from the bug then, or 2) add the following line of code near the top of your script, just under your require statements.
Code:
OpenStruct.__send__(:define_method, :type) { @table[:type] }
That gets rid of the bug and you will be able to read the type of record without problem.
Hope this helps someone, cheers.
-Musfuut