vigetlabs/garb — Issue #115: Requesting list of segments raises TypeError exception
Author: jwtd
Created: 2012-03-09 17:03:40+00:00
State: open

Using:
Ruby 1.9.3
garb 0.9.1

Running sample code from: https://github.com/vigetlabs/garb/wiki/Segments which is...

Garb::Management::Segment.all.each {|segment| puts "#{segment.id}:#{segment.name} => #{segment.definition}"}

Raises a TypeError exception...

/Users/jd/.rvm/gems/ruby-1.9.3-p125@rails-3.2/gems/garb-0.9.1/lib/garb.rb:67:in `[]': can't convert String into Integer (TypeError)
from /Users/jd/.rvm/gems/ruby-1.9.3-p125@rails-3.2/gems/garb-0.9.1/lib/garb.rb:67:in `block in parse_link'
from /Users/jd/.rvm/gems/ruby-1.9.3-p125@rails-3.2/gems/garb-0.9.1/lib/garb.rb:67:in `each'
from /Users/jd/.rvm/gems/ruby-1.9.3-p125@rails-3.2/gems/garb-0.9.1/lib/garb.rb:67:in `detect'
from /Users/jd/.rvm/gems/ruby-1.9.3-p125@rails-3.2/gems/garb-0.9.1/lib/garb.rb:67:in `parse_link'
from /Users/jd/.rvm/gems/ruby-1.9.3-p125@rails-3.2/gems/garb-0.9.1/lib/garb/management/segment.rb:15:in `new_from_entry'
from /Users/jd/.rvm/gems/ruby-1.9.3-p125@rails-3.2/gems/garb-0.9.1/lib/garb/management/segment.rb:9:in `block in all'
from /Users/jd/.rvm/gems/ruby-1.9.3-p125@rails-3.2/gems/garb-0.9.1/lib/garb/management/segment.rb:9:in `map'
from /Users/jd/.rvm/gems/ruby-1.9.3-p125@rails-3.2/gems/garb-0.9.1/lib/garb/management/segment.rb:9:in `all'