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

MTG::Card.all fails - undefined method call for Date:Class #13

Open
hslzr opened this issue Feb 24, 2023 · 0 comments
Open

MTG::Card.all fails - undefined method call for Date:Class #13

hslzr opened this issue Feb 24, 2023 · 0 comments

Comments

@hslzr
Copy link

hslzr commented Feb 24, 2023

Without changing the api_version to 2 I get:

3.2.0 :001 > require 'mtg_sdk'
 => true
3.2.0 :002 > MTG::Card.all
/Users/salazar/.rvm/gems/ruby-3.2.0/gems/representable-3.2.0/lib/representable/coercion.rb:15:in `call': undefined method `call' for Date:Class (NoMethodError)

        @type.call(input)
             ^^^^^
	from /Users/salazar/.rvm/gems/ruby-3.2.0/gems/representable-3.2.0/lib/representable/pipeline.rb:19:in `evaluate'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/gems/representable-3.2.0/lib/representable/pipeline.rb:10:in `block in call'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/gems/representable-3.2.0/lib/representable/pipeline.rb:9:in `each'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/gems/representable-3.2.0/lib/representable/pipeline.rb:9:in `inject'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/gems/representable-3.2.0/lib/representable/pipeline.rb:9:in `call'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/gems/representable-3.2.0/lib/representable/deserializer.rb:87:in `block in <module:Representable>'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/gems/representable-3.2.0/lib/representable/pipeline.rb:19:in `evaluate'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/gems/representable-3.2.0/lib/representable/pipeline.rb:10:in `block in call'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/gems/representable-3.2.0/lib/representable/pipeline.rb:9:in `each'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/gems/representable-3.2.0/lib/representable/pipeline.rb:9:in `inject'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/gems/representable-3.2.0/lib/representable/pipeline.rb:9:in `call'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/gems/representable-3.2.0/lib/representable/binding.rb:55:in `uncompile_fragment'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/gems/representable-3.2.0/lib/representable/binding.rb:14:in `block in call'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/gems/representable-3.2.0/lib/representable/binding.rb:12:in `each'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/gems/representable-3.2.0/lib/representable/binding.rb:12:in `call'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/gems/representable-3.2.0/lib/representable.rb:68:in `representable_map!'

After that, I get...

3.2.0 :003 > MTG.configure do |config|
3.2.0 :004 >   config.api_version = 2
3.2.0 :005 > end
 => 2
3.2.0 :006 > MTG::Card.all
/Users/salazar/.rvm/gems/ruby-3.2.0/gems/mtg_sdk-3.2.1/lib/mtg_sdk/query_builder.rb:53:in `all': undefined method `empty?' for nil:NilClass (NoMethodError)

        if !data.empty?
                ^^^^^^^
	from /Users/salazar/.rvm/gems/ruby-3.2.0/gems/mtg_sdk-3.2.1/lib/mtg_sdk/card.rb:33:in `all'
	from (irb):6:in `<main>'
	from /Users/salazar/.rvm/rubies/ruby-3.2.0/lib/ruby/gems/3.2.0/gems/irb-1.6.2/exe/irb:11:in `<top (required)>'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/bin/irb:25:in `load'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/bin/irb:25:in `<main>'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/bin/ruby_executable_hooks:22:in `eval'
	from /Users/salazar/.rvm/gems/ruby-3.2.0/bin/ruby_executable_hooks:22:in `<main>'
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

1 participant