Skip to content

Parsing error: no implicit conversion of Symbol into Integer #30

@ryanfox1985

Description

@ryanfox1985

Hi @arturictus,

nice mapper, recently I had this error:

TypeError: no implicit conversion of Symbol into Integer
File "/ruby-app/vendor/bundle/ruby/2.3.0/gems/hash_map-0.4.0/lib/hash_map/mapper.rb" line 52 in []
File "/ruby-app/vendor/bundle/ruby/2.3.0/gems/hash_map-0.4.0/lib/hash_map/mapper.rb" line 52 in block in get_value_from_key
File "/ruby-app/vendor/bundle/ruby/2.3.0/gems/hash_map-0.4.0/lib/hash_map/mapper.rb" line 50 in each
File "/ruby-app/vendor/bundle/ruby/2.3.0/gems/hash_map-0.4.0/lib/hash_map/mapper.rb" line 50 in inject
File "/ruby-app/vendor/bundle/ruby/2.3.0/gems/hash_map-0.4.0/lib/hash_map/mapper.rb" line 50 in get_value_from_key
File "/ruby-app/vendor/bundle/ruby/2.3.0/gems/hash_map-0.4.0/lib/hash_map/mapper.rb" line 26 in get_value
File "/ruby-app/vendor/bundle/ruby/2.3.0/gems/hash_map-0.4.0/lib/hash_map/mapper.rb" line 12 in block in output
File "/ruby-app/vendor/bundle/ruby/2.3.0/gems/hash_map-0.4.0/lib/hash_map/mapper.rb" line 11 in each
File "/ruby-app/vendor/bundle/ruby/2.3.0/gems/hash_map-0.4.0/lib/hash_map/mapper.rb" line 11 in output
File "/ruby-app/vendor/bundle/ruby/2.3.0/gems/hash_map-0.4.0/lib/hash_map/base.rb" line 28 in output

Here is my mapper:

class HotelSegmentMapper < BaseMapper
    ....
    property :name, from: [:property_name, :hotel_name]
    ...
end

And my run case is when property_name is just a string and not hash type.
Maybe can be good to have another error message to notice this error.

Thanks!

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions