Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List reading issue #49

Open
alexey opened this issue Aug 30, 2016 · 2 comments
Open

List reading issue #49

alexey opened this issue Aug 30, 2016 · 2 comments

Comments

@alexey
Copy link

alexey commented Aug 30, 2016

According to this example:

lists = client.get_lists
lists.each do |list|
  puts list.id              # => Fixnum
  puts list.name            # => 'new_list'
  puts list.recipient_count # => Fixnum

I get error:

NoMethodError: undefined method `id' for #<Array:0x007fcbe4bbebf0>

Lists array looks like:

 => #<struct SendGrid4r::REST::MarketingCampaigns::Contacts::Lists::Lists lists=[#<struct SendGrid4r::REST::MarketingCampaigns::Contacts::Lists::List id=542087, name="buyers", recipient_count=0>, #<struct SendGrid4r::REST::MarketingCampaigns::Contacts::Lists::List id=542086, name="sellers", recipient_count=0>, #<struct SendGrid4r::REST::MarketingCampaigns::Contacts::Lists::List id=542088, name="subscribers", recipient_count=0>]>
@alexey
Copy link
Author

alexey commented Aug 30, 2016

Work only if:

lists[0].each do |list|
...

@awwa
Copy link
Owner

awwa commented Sep 12, 2016

Hello @alexey,
The document was incorrect.
I fixed that.

lists.lists.each do |list|
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants