< :the previous in number
^ :the list in numerical order
> :the next in number
P :the previous (in thread)
N :the next artilce (have the same parent)
|<:the top of this thread
>|:the next thread
^ :the parent (reply-to)
_:the child (an article replying to this)
>:the elder article having the same parent
<:the youger article having the same parent
---:split window and show thread lists
| :split window (vertically) and show thread lists
~ :close the thread frame
.:the index
..:the index of indices
On Jun 19, 2006, at 3:51 PM, dan donaldson wrote:
> I have an array of names in string form as an instance var. The class
> the array is in has a method that takes an array of string values.
>
> I want to construct an associative array such that the names in the
> first array are the keys to the values in the received array.
>
> this throws an error:
> --------------
> def initialize
> @labels = ['prov', 'area', 'zone', district', 'postalcode',
> 'city_prov', 'addr']
> @pageData = {}
> end
>
> def adddata(data)
> max = data.length
> max -= 1
> 0.upto(max) {|i| @pageData[@labels[i]] => data[i] }
> end
>
> --------------
>
> obviously, some giant conceptual leap needs to be made, or its a
> miniscule typo. (methinks the former)
>
> Anyone got advice?
It's hard to know without the error, but adddata() doesn't look great
to me. Try something like this:
def add_data(data)
data.each_index do |index|
@pageData[@labels[i]] = data[i]
end
end
-Mat